In this post, I am gonna help you to understand a custom functionality to get the Record ID in a custom field of your Record. Now if you have a question like why we would need the Record ID to be stored in a custom field. So this is actually a general question which can popup in your mind. So If you have been using your data for different types of usages then at some point you would have noticed to track your Records based on a specific key Or ID. So in that Case, Record Id is the right value to track your records and use them appropriately inside the Zoho Apps or Outside using APIs.

Steps to Create Worflow in Zoho CRM

  1. Go to Setup
  2. Go to WorkFlow Rules
  3. Click +Create Rule
  4. Select Module “Referrals” (In My Case)
  5. Enter Rule Name “Referral Count” (In My Case)
  6. Select When This Workflow should Trigger – “On a record action – Create
  7. Select First Condition – “All Referrals
  8. In Instant Action Select – “Function
  9. Click on “+New Function
  10. Click on “Write your own function
  11. Enter Your Function Name & Rule Name something like “Store_Contact_ID
  12. Now you can see the Function writing screen where you will see an option “Edit Arguments“.
  13. Click on Edit Arguments
  14. In Key Field, Create a Key “ContactId
  15. In Param Value Field, Type # and you will see Module select field. Select “Contacts” & Other Fields pop up just after the Module selection. Select “Contact ID
  16. Now, Save the Argument & Move to The Function screen to write your custom function.

Custom Function to Get Record ID & Insert it into Custom Field.

response = zoho.crm.getRecordById("Contacts",contid);
myMap = Map();
// User_ID is the Key for Long_Integer Field in Zoho CRM to store the Record ID. //
resp_update = zoho.crm.updateRecord("Contacts", contid,myMap);

info resp_update ;

Now as your function is ready to use. So let’s Save and Execute it for testing. So Click on “Save & Execute” and It will ask you to enter a Contact Record ID. So Get the Record ID for a Contact and Insert the ID in the input field and see if works fine and doesn’t give any error. If the code worked successfully then Click on Final “Save” button and then Save Workflow as well.

Now your workflow is ready to use.

If This Post helped you then share it with your connection and if you need any help to Set up Your Zoho Subscription, You can Share your Details to request a Quotation.