I got an object called 'Category' which has a master detail relationship with 'Scheme' object, 'category' has a pick list field called 'Type' & it has different values Ex:Cost,Time etc.
I need to write a trigger to validate selection of pick-list values. Once a pick-list value is selected it should not be used in another record and if user tries to select that same pick-list value and try to save in a new record, it should give an error and should not be able to save the record.
I'm bit confused as I have not done such scenario before.
Best Answer
Can you try the following code.It should work.