function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
lewislewis 

new to triggers . plshelp

can someone help with a trigger or an advise howe this can be done

 

I have a custom object "phone" . There are two fields in it that i need a validation or trigger to work on . the users add data to all the fields . one field " total Kilos"  wherein the user puts an amount . i have another field  "Decision made" which is a checkbox field . when the record goes in for aan approval process,  one of the approvers in the line use their quota of approvals and clicks on this box " decision made" and saves the record. when they then approve , the record is approved and doesnt go to the next approver  .

 

usually each approver in the line has a limit on how many total kilos they can use their quota to approve .. ie . a sales manager profiel can only be the final approver if the total kilos is 10 .

 

i need a validation after the checkbox is saved , that checks who has saved the record and what is the total kilos ? if the kilos is above what the approver can use, the field " allow to approve" is checked .

 

ie. IF ( decsion made = true ,  (profile = sales manager, total kilos = 10 ), (profile = country manager , total kilos = 15) , then update the allow to approve field with a check box  .