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
Ricardo OrtegaRicardo Ortega 

Problem with workforce rule and junction object

I have a junction object with two master relationships, one to contacts and one to a custom object named Program. I wanted to avoid the duplication of the junction object using a workforce rule (i know it can be done with trigger but bear with me). I created a field named "duplicate test" that is set to avoid duplicates . Then I went to create a workforce rule that is set to my junction object and has no criteria YET. Then I added to immediate workflow actions a field update that is set to my new "duplicate test" and i assigned the formula "CASESAFEID(Contact__c) & '-' & CASESAFEID(Program__c)".  I tried too "Contact__r.Email &"-'&Program__r.Name" but to no avail.

 

Problem is, neither are working (i already activated that wf). The field update doesn't set any value and therefore it doesn't test for duplicate. Also can someone tell me what criteria should I put in the wf rule? Thanks,

Bhawani SharmaBhawani Sharma
Create a new text field as Unique. Set it default to "ContactId-ProgramId".
Ricardo OrtegaRicardo Ortega

I tried but it keeps saying either field doesn't exist or this field can't be used in this type of formula