Autopopulate venue in Events from Accounts

Autopopulate venue in Events from Accounts

Many would like to auto-populate Accounts Shipping Address into the Venue field on creating an event.  This can be accomplished with the help of custom functions by following these simple steps:

 

Step 1:  Create custom function:

 

Go to Setup > Automation > Custom functions > Configure Custom Function > Write your own > Select the module you have create custom function for > Give the function name > Click Edit Arguments > Select the fields > Save > Paste the below code and  click Save.

 

eventIdStr = input.eventid.toString() ; 

 accDetails = zoho.crm.getRecordById(("Accounts") ,input.accountid ) ; 

 street = ifnull(accDetails.get("Shipping Street"),"") ; 

 city = ifnull(accDetails.get("Shipping City"),"") ; 

 state = ifnull(accDetails.get("Shipping State"),"") ; 

zip = ifnull(accDetails.get("Shipping Code"),"") ; 

 country = ifnull(accDetails.get("Shipping Country"),"") ; 

 address = ((street + " " + city + " " + state + " " + country) + " ") + zip ; 

mp = map() ; 

mp.put("Venue",address);

updateResp = zoho.crm.updateRecord("Events" ,eventIdStr ,mp ) ; 

 
Step 2:  Now associate custom function with workflow rule:

 

Goto Setup > Automation > Rules > Create Rule > Select the Events module > Give a rule name and other details > Click Next > Select Execute based on record action > Select radio button Create or Edit > Click Next > Give criteria, if you need any > Click Next > Click Associate > Select custom function > Associate and Save the rule.    




Regards,
Vidya,
Zoho CRM Support