You need to sign in to do that
Don't have an account?
anshuman mishra
0down votefavorite
I am creating a junction object called Candidate_Position.This has two parents candidate and position.I have to go to the Candidate Detail page and in the related list create a new Candidate Position.The next page is a VF page where I select the Position to associate with the new Candidate Position and click save.The condition however is,I have to validate if the position I am associating is not already associated with any Candidate Position having the same Candidate parent. For example if there is Candidate "Paul",and under that I am creating a Candidate Position trying to associate Position "Dev",the other Candidate Positions under Candidate "Paul" should not have "Dev" as parent Position.
So what Validation Rule I have to give for the Junction Object?
I am completely new to Salesforce,and would appreciate some answers.Thanks :-)
Validation rule for Junction Object to check if both parents have been repeated or not
0down votefavorite
I am creating a junction object called Candidate_Position.This has two parents candidate and position.I have to go to the Candidate Detail page and in the related list create a new Candidate Position.The next page is a VF page where I select the Position to associate with the new Candidate Position and click save.The condition however is,I have to validate if the position I am associating is not already associated with any Candidate Position having the same Candidate parent. For example if there is Candidate "Paul",and under that I am creating a Candidate Position trying to associate Position "Dev",the other Candidate Positions under Candidate "Paul" should not have "Dev" as parent Position.
So what Validation Rule I have to give for the Junction Object?
I am completely new to Salesforce,and would appreciate some answers.Thanks :-)
1) Create 1 text field on candidate_position and make it unique(checking unique checkbox true)
2) create a workflow on candidate_position for "every time created and updated" . It will update the newly checkbox with position.Name+candidate+name.
and Its done.
first you will create candidate with Paul , dev and it will create candidate_position record and workflow will update the text field with paul+dev.
2nd time if you will try to create the record with same vaules, it will through the error as it is unique field.