Zoho CRM Validation Rule Using Lookup Field

Zoho CRM Validation Rule Using Lookup Field

Hello,

In Zoho CRM Opportunities module, we have the following fields:
  1. "Proposal Team Member1": Lookup field for User. (I think it's connected to Zoho People P_Employee form?)
  2. "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:
  1. This Validation Rule document, but it does not support Lookup fields for adding criteria.
  2. The following custom function code, but probably the entityMap label names and Zoho People connection are wrong:
  1. entityMap = crmAPIRequest.toMap().get("record");
  2. response = Map();
  3. contribution_member1 = entityMap.get("Proposal_Team_Member_1_Contribution_%");
  4. id_member1 = entityMap.get("Proposal_Team_Member1");
  5. emp1 = zoho.people.getRecordByID("P_Employee",id_member1);
  6. if(emp1.Designation == 'Partner' && contribution_member1 > 10)
  7. {
  8. response.put('status','error');
  9. response.put('message',"Partner contribution cannot be more than 10%");
  10. }
  11. else
  12. {
  13. response.put('status','success');
  14. }
  15. return response;

Could you please tell me if this is possible and what do I do wrong?
Thank you.