Print

Zoho Creator: Assign an integration field value with an integration value

What?
This is a quick article to help anyone encountering this gotcha: I have an integration field, if someone changes it, I want to save the value to the record immediately.

Why?
If you try to update an integration field via deluge with another integration field or even the same integration field, it will return an error
Unable to update the value to r_RecordDetails.Account. Line:(442)

How?
It is written in the documentation albeit difficult to find: an integration field returns an ID as a string. If you want to assign it to an integration field, you have to convert it to a number with .toLong().

Say I have an integration field on my form called "CRM Account" with field link name "Account";

Then I have a workflow on user input of the field to save this directly to the record;

You would think the following would work:
copyraw
r_Details = myForm[ID == 1234567890123456789];
r_Details.Account = input.Account;
  1.  r_Details = myForm[ID == 1234567890123456789]
  2.  r_Details.Account = input.Account; 
But it will return the above error.

You need to do the following:
copyraw
r_Details = myForm[ID == 1234567890123456789];
r_Details.Account = input.Account.toLong();
  1.  r_Details = myForm[ID == 1234567890123456789]
  2.  r_Details.Account = input.Account.toLong()


Category: Zoho :: Article: 753