Forum Post: Checking related records for deleted records before updating

  • Thread starter Thread starter matman
  • Start date Start date
Status
Not open for further replies.
M

matman

Guest
In this post I talked about checking whether a default contact person is an employee of the employer. Instead of using triggers, I started using validations. After researching for a while I was able to come up with the following code: var found = false; var cpn = 0; if({!R108244245}) { cpn = {!R108244245}; } else { cpn = {!R108244245.id}; } if(cpn) { {!#LOOP_BEGIN.R108244227} if(cpn == {!R108244227.id}) { found = true; } {!#LOOP_END.R108244227} if(!found) {return "Kan niet updaten, er mist een werknemer bij contactpersoon!";} } It works. However, I do wonder.. Is there a way to do this without having to retry and edit for 2 hours? :/ Thanks in advance!

Continue reading...
 
Status
Not open for further replies.
Back
Top