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
rotfilrotfil 

Validate on the presence of a note on the Lead object for a stage

I have a stage that I need to validate against a note on the Lead object.

Note

So what needs to happen:

- A user adds a note (anything!)
- Then I can make the first stage as complete otherwise

Is this a validation rule or a trigger - and how would I go about either?

Thanks,
James
Kaustubh LabheKaustubh Labhe
Hi,

A before update trigger on Lead object. Query for all Note (select id, parentid from note where ParentId IN LeadID) and store it in a list.
Now if the List is empty and if the user is trying to change the first stage, then .addError(You cannot change this as there are no notes). 
Hope this is clear. 

Thanks