Zoho CRM Validation Rule Using Lookup Field
Hello,
In Zoho CRM Opportunities module, we have the following fields:
- "Proposal Team Member1": Lookup field for User. (I think it's connected to Zoho People P_Employee form?)
- "Proposal Team Member 1 Contribution %": Number
What I need to do is set a validation that, if the employee role of "Proposal Team Member1" is "Partner", then "Proposal Team Member 1 Contribution %" cannot exceed 10%.
What I tried:
- This Validation Rule document, but it does not support Lookup fields for adding criteria.
- The following custom function code, but probably the entityMap label names and Zoho People connection are wrong:
entityMap = crmAPIRequest.toMap().get("record");
response = Map();
contribution_member1 = entityMap.get("Proposal_Team_Member_1_Contribution_%");
id_member1 = entityMap.get("Proposal_Team_Member1");
emp1 = zoho.people.getRecordByID("P_Employee",id_member1);
if(emp1.Designation == 'Partner' && contribution_member1 > 10)
{
response.put('status','error');
response.put('message',"Partner contribution cannot be more than 10%");
}
else
{
response.put('status','success');
}
return response;
Could you please tell me if this is possible and what do I do wrong?
Thank you.