- Joined
- Jun 24, 2010
- Messages
- 57
- Reaction score
- 0
I have created a call flow that will successfully verify a customer from caller id via a sql database
The functionality is simple
When call comes in go directly to verify if the callerid exists in a sql database
If it exist look for the assigned agent from the last call by finding the extension of that agent in the database.
Everything seems to work as it should until I assign the query result of my query to get the agents direct extension
Here is my query
DECLARE @maxid INT
SET @maxid =
(SELECT MAX(ID)
FROM [CRM].[dbo].[CallLog]
WHERE Callerid = 2075708994)-- RIGHT({0}, 10))
SELECT LEFT(DirectCallExtension,4) As DirectCallExtension
FROM [CRM].[dbo].[CallLog]
WHERE ID = @maxid
AND DirectCallExtension IS NOT NULL
The result is a single 4 digit nchar of 7201 which is the extension I want.
I am pretty sure through my testing that the query is fine however when I add the variable assignment it makes the whole thing not work and just disconnects the call. I have attached a screenshot of the Expression Editor where I am assigning the value to the Variable
Really stuck on this and have a hard deadline to meet and support is not responding.
Thanks
Jim
The functionality is simple
When call comes in go directly to verify if the callerid exists in a sql database
If it exist look for the assigned agent from the last call by finding the extension of that agent in the database.
Everything seems to work as it should until I assign the query result of my query to get the agents direct extension
Here is my query
DECLARE @maxid INT
SET @maxid =
(SELECT MAX(ID)
FROM [CRM].[dbo].[CallLog]
WHERE Callerid = 2075708994)-- RIGHT({0}, 10))
SELECT LEFT(DirectCallExtension,4) As DirectCallExtension
FROM [CRM].[dbo].[CallLog]
WHERE ID = @maxid
AND DirectCallExtension IS NOT NULL
The result is a single 4 digit nchar of 7201 which is the extension I want.
I am pretty sure through my testing that the query is fine however when I add the variable assignment it makes the whole thing not work and just disconnects the call. I have attached a screenshot of the Expression Editor where I am assigning the value to the Variable
Really stuck on this and have a hard deadline to meet and support is not responding.
Thanks
Jim