You are viewing limited content. For full access, please sign in.

Question

Question

Must be of type double and should not be enclosed in quotes, Issue with Workflow that uses Update Data to Update A Record in Salesforce

asked on July 2, 2015

We have a workflow where, based on a field value, uses Update Data to update values in our Salesforce.

The datasource is valid - it tests out, etc... we're using an ODBC connection to call Salesforce.  With logging turned on for the ODBC connection we can see the error coming back from Salesforce:

Jul 02 12:13:34 ERROR 5700 Statement::SQLExecDirectW: INVALID_FIELD: 
BD_Transaction_ID__c FROM Opportunity WHERE ( BD_Transaction_ID__c = '107768'
                                              ^
ERROR at Row:1:Column:71
value of filter criterion for field 'BD_Transaction_ID__c' must be of type double and should not be enclosed in quotes

You can see Laserfiche Workflow is putting quotes around that value.

Unlike when using Custom Query and a Query Parameter, that you can tell workflow the type, in this case there is no place to define the type.

Is there a way to get around this?

0 0

Answer

SELECTED ANSWER
replied on July 2, 2015

This is a limitation of the activity because we leave the data conversion up to the driver. The behavior differs from driver to driver unfortunately. Using a custom query is the recommended workaround.

0 0

Replies

replied on July 2, 2015

Right, I forgot a custom query could also be an update statement.  I was thinking only SELECT. Thanks!

0 0
replied on July 2, 2015 Show version history

A quick followup to this... I have my custom query, and it looks like I can pass values to the update via parameters, but right now the parameters aren't evaluating... they are just sent as strings to the update statement:

UPDATE Opportunity SET Description = ? WHERE BD_Transaction_ID__c = ?

And my first parameter is set as

%(DateTime)

What gets written to Salesforce is %(DateTime), not 7/2/2015, etc...

The second parameter is the Transaction ID that is needed in the WHERE clause.

How do I get it to evaluate the value?

0 0
replied on July 2, 2015

Hey Greg - 

For the first parameter, is the Type set to DateTime? And is the second Parameter Value set to the full token %(RetrieveFieldValues_TransactionID)?

0 0
replied on July 2, 2015

The second parameter yes is set to that and the type is set to INT32 (which was our problem before).

The first parameter I tried setting type = DateTime but then it throws this error in Workflow when I test it:  "Failed to convert parameter value from a String to a DateTime".

So then I change that parameter back to type = string, and the update runs, but this is what ends up in the field in Salesforce for that record: %(DateTime)

0 0
replied on July 3, 2015

Are you seeing this when you test run the workflow in the designer or is this happening when the workflow is triggered in production as well?  When testing, a dialog box pops up to input test values.  This dialog does not resolve tokens, so if it is just seen in testing, put an actual date time value into the dialog.  Also, test it by triggering the workflow from the client.

0 0
replied on July 3, 2015

Ah... that I didn't know.  Yes I was only testing via the Test button.   I haven't actually tried running the workflow to test this. 

0 0
replied on July 6, 2015

Bert... thanks for that tip!  You are right, this works when actually running the workflow. The data tokens are resolved. 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.