Problem with 3CX Mysql create contact

Status
Not open for further replies.

greychain

Gold Partner
Advanced Certified
Joined
Jul 13, 2018
Messages
779
Reaction score
122
I am trying to insert a contact record into mysql using the following statement shown below.

When it runs I get Object reference not set to an instance of an object. I'm fairly sure it this , '[[CallStartTimeLocal].ToString("yyyy-MM-ddTHH:mm:ssZ")]', that is causing the problem.

The same SQL statement in Call Journaling does work and correctly formats the time.

INSERT INTO calls (phonebusiness, firstname, lastname, agentextension, description, calldatetime, callduration) VALUES ('[Number]', '[Number]', '[Number]', '[Agent]','3CX PhoneSystem Call', '[[CallStartTimeLocal].ToString("yyyy-MM-ddTHH:mm:ssZ")]', '[Duration]')

following guidelines at https://www.3cx.com/docs/server-side-crm-template-xml-description/#h.vcivldjsa1lz


Started CreateContactRecord
System.NullReferenceException: Object reference not set to an instance of an object.
at TcxLexicalParser.LexEvaluator.InstanceFunction(IValueManager valueManager, FunctionElement functionElement)
at TcxLexicalParser.LexEvaluator.Process(Element element, IValueManager valueManager, Boolean isFunctionArgument)
at TcxLexicalParser.LexEvaluator.ProcessInt(ConcatElement concatElement, IValueManager valueManager, Boolean isFunctionArgument)
at TcxLexicalParser.LexEvaluator.Process(Element element, IValueManager valueManager, Boolean isFunctionArgument)
at CrmIntegration.EscapedExpressionEvaluator.ParseExpression(String expression, Boolean asExpression, IValueManager customManager)
at CrmIntegration.ScenarioProcessorBase.ProcessSQLDatabaseQuery(ISQLClientFactory sqlClientFactory, ScenarioQuery query, IValueManager customManager, CancellationToken token)
at CrmIntegration.ScenarioProcessorBase.ProcessScenario(ProtocolScenario scenario, IValueManager customManager, CancellationToken token)
at CrmIntegration.ScenarioProcessorBase.Execute(ProtocolScenario scenario, CancellationToken token)
at CrmIntegration.CrmProcessor.CreateContactRecord(IValueManager customManager, String scenarioId, Func`2 filterResultsFunctor, CancellationToken token)
 
The variable [CallStartTimeLocal] is not available during contact lookup / contact creation. It's only for call journaling.
 
Thanks, re-reading that page slowly I can see that now.
 
  • Like
Reactions: edossantos
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
112,323
Messages
591,896
Members
165,474
Latest member
costionofrei