Function that can check a field in a subform and if it is saved for a value less than a specific number it changes another field to a certain value
Hi, I have a field called Fees in a subform and I want to create a function to change another field called Rate Change Approval Status to be pending approval if the value of Fees field is changed to be less than 2
Note: all these fields are in accounts module.
Wrote that script but it is not working at all.
- Fees = "Fees";
- Fees_Rates = "Fees_Rates";
- Rate_Change_Approval = "Rate_Change_Approval";
- fees = toDecimal(getFieldValue(Fees));
- fees_rates = toDecimal(getFieldValue(Fees_Rates));
- rate_change_approval = toText(getFieldValue(Rate_Change_Approval));
- if (fees < 2.00 || fees_rates < 2.00) {
- if (rate_change_approval != "Pending Approval") {
- update_rate_approval = zoho.crm.updateRecord("Accounts", rate_change_approval, {"Rate_Change_Approval": "Pending Approval"});
- info update_rate_approval;
- }
- }