Call Journaling

Status
Not open for further replies.

NOC12

Trial User
Joined
Apr 11, 2022
Messages
8
Reaction score
1
Hi,

I set up Call Journaling and was working fine but it has stopped working now.

INSERT INTO calls (contactnumber, agentexention, description, calldatetime, callduration, calldirection, name, calltype, entityid, entitytype, firstname) VALUES ('[Number]', '[Agent]', '3CX PhoneSystem Call', '[DateTime]', '[Duration]','[CallDirection]','[Name]','[CallType]','[EntityId]','[EntityType]','[AgentFirstName]')

This is the error

022/09/14 11:45:18.244|7344|0039|Erro|CRM: Exception during call reporting: System.Data.SqlClient.SqlException (0x80131904): The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.

What do I change in the query to fix it?

Thank you
 
It seems that the calldatetime field in your database is a DateTime. However, the [DateTime] variable has not the expected format, and can't be converted from string to a DateTime. This might be caused by localization mismatch between the 3CX server and the database server. For example, one providing MM/DD and other providing DD/MM. Then, when the day is greater than 12 you get this error.

If you don't really care about the database field format, the easiest fix is changing your database to store a varchar instead of a DateTime. Otherwise, you would need to properly format the datetime. To do that you would need to use a C# expression. Instead of using:
[DateTime]

You should use:
[[CallStartTimeLocal].ToString("yyyy-MM-ddTHH:mm:ssZ")]
 
Changing the datatype to Varchar worked, thank you
 
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
111,973
Messages
590,075
Members
164,895
Latest member
jasonkkrause