I am trying to get the user details for a record owner so that I can use them in my function. We have a specific business case for franchise organizations. We have over 100 of our franchises using a single instance of our CRM. We need to have a contact record be stamped with the franchise name based on the record owner. For this we are trying to get the franchise name from a custom field we added to the user record. We would love to get the role -but that does not seem possible. Here is the code I am using - I am able to get the getrecrods to return the correct user - but the data is not available to me when I try and create a variable from the getrecords result: FYI - I have hidden the sensitive information below and highlighted the data that I want to get into a variable.
ROLENAME = zoho.crm.getRecordById("users",UserID.toLong());
ROLESEARCH = zoho.crm.searchRecords("users","(ID:equals:" + UserID + ")");
info "result" + ROLENAME;
info "..................";
info "result" + ROLESEARCH;
info "..................";
RoleLocation = ROLENAME.get("Role");
Rolesearch1 = ROLESEARCH.get("Franchise_Location");
RoleLocation2 = ROLENAME.get("first_name");
RoleID = ROLENAME.get("ID");
info "Role: " + ROLENAME.get("Role_Name");
info "RoleID: " + ROLENAME.get("Id");
info "Roleloc: " + RoleLocation;
info "Rolesearch1: " + Rolesearch1;
info "Roleloc2: " + RoleLocation2;
info "..................";