Skip to content

Instantly share code, notes, and snippets.

@CubeYogi
Created November 18, 2020 07:36
Show Gist options
  • Save CubeYogi/5e8f8c43aecf2b47a9c1d15136a823ee to your computer and use it in GitHub Desktop.
Save CubeYogi/5e8f8c43aecf2b47a9c1d15136a823ee to your computer and use it in GitHub Desktop.
//Validating custom module ID
if(record_id != null)
{
//Getting custom module entry
//Replace your custom module link name if needed
custom_module_entry = zoho.crm.getRecordById("Listings",record_id);
//Validating custom module entry
if(!custom_module_entry.isEmpty())
{
custom_module_map = Map();
//Getting custom module value
//Replace your field link name if needed
get_address = custom_module_entry.get("Street_Address");
mls_number = custom_module_entry.get("Mls_Number");
//Validating custom module address
if(get_address != null && get_address.trim() != "")
{
//formatting main address
name = get_address.proper()+ "-"+mls_number;
//Replace your field link name if needed
custom_module_map.put("Name", name);
custom_module_map.put("Street_Name", get_address.proper());
//Updating custom module entry
update_custom_module = zoho.crm.updateRecord("Listings",record_id,custom_module_map);
//Validating custom module response
if(!update_custom_module.isEmpty() && update_custom_module.containKey("status") && update_custom_module.get("status") == "error")
{
info "Error in updating custom module: "+update_custom_module;
}
else
{
info "custom module updated successfully";
}
}
else
{
info "Address is empty";
}
}
else
{
info "Invalid custom module entry";
}
}
else
{
info "custom module ID invalid";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment