Intro warning - brand new to Zoho, complete amateur at script writing but with some background in IT, trying to figure out Deluge for more efficient system operation.
We're importing a large set of data from an old CRM into Zoho, including a Membership Number field, which is fine for old records. But for new records, we need this field to autofill with a new membership number on creation. For this purpose I've set up an additional 'auto number' field named "Membership Number Auto" which will provide a new number on create. But as I caan't prefill this field with previously existing membership numbers, I'm stuck having to use two fields for the same data based on whether the account is old or new.
My solution (I thought) would be to set a function to auto update the Membership Number field, when blank, with the data from Membership Number Auto, and effectively hide the Membership Number Auto field so that it only appears for top level admin users (aka, me). Makes sense.
I found some function code online but am having no luck getting it to work with my data set, no matter what I try.
Argument;
ContactsID = Members - Membership Number
Module = Members, API Name = Contacts
Code;
ContactsDetails = zoho.crm.getRecordById("Contacts",ContactsID);
createMap = Map();
createMap.put("Membership_Number",ifnull(ContactsDetails.get("Membership_Number_Auto"),""));
info createMap;
It seems to save fine but just reports a fail;
Value is empty and 'get' function cannot be appliedat lineNumber 5
Any more seasoned coders have an idea as to what this newbie is doing wrong?