VAD EXPRESSION - NOW()

Dedicated forum for the visual 'drag and drop' voice application designer that allows easy creation of advanced voice applications without programming knowledge

Moderators: kevin, 3CX staff

VAD EXPRESSION - NOW()

Postby SWSDEV » Fri Oct 09, 2009 6:42 am

I am finding that the NOW() function is not returning anything at all.

Am I supposed to put something in between the parenthesis in the function?
Shahzad Qureshi
SWS Development - 3CX Certified Partner
Custom 3CX integration
Salt Lake City, UT USA
801-938-7712
swsdev.com
SWSDEV
Expert
Expert
 
Posts: 246
Joined: Sat Feb 23, 2008 6:51 am
Location: Salt Lake City, Utah - USA

Re: VAD EXPRESSION - NOW()

Postby SWSDEV » Fri Oct 09, 2009 7:53 am

I have tried to use the VAD's NOW function in assigning a value to a date field in a database and it simply will not work, and crashes the call flow every time. I have tried assigning hte NOW function to a variable as well. I have tried with the datatype in the database as both a datetime and a varchar. I have tried many different possible syntaxes. My final workaround was to not use the VAD, but to just put a trigger on my table to update my field to timestamp the creation of the record. IT works but it doesn't use the VAD at all.
Shahzad Qureshi
SWS Development - 3CX Certified Partner
Custom 3CX integration
Salt Lake City, UT USA
801-938-7712
swsdev.com
SWSDEV
Expert
Expert
 
Posts: 246
Joined: Sat Feb 23, 2008 6:51 am
Location: Salt Lake City, Utah - USA

Re: VAD EXPRESSION - NOW()

Postby VAD_Support » Fri Oct 09, 2009 2:07 pm

Where are you calling the NOW() function? If you're trying to insert the current date and time into a database, you should use the database syntax for that. For example, if you're using SQL Server, you should use GETDATE(). If you want to use NOW(), have in mind that the return value will be treated as a string, so if your database field is a datetime you will need to convert it. Also, the SQL statement should have quotes rounding the parameter.

For example, using GETDATE:
insert into TABLE (DateField) values (GETDATE())

Using NOW():
insert into TABLE (VarcharField) values ('{0}')
having a parameter with value NOW()

If you do not use quotes in the SQL statement, you will have a runtime error.

Let me know if this helps.
VAD_Support
3CX Valued Professional
3CX Valued Professional
 
Posts: 421
Joined: Thu Aug 06, 2009 5:29 pm


Return to 3CX Voice Application Designer (VAD)

Who is online

Users browsing this forum: No registered users and 1 guest