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
nusrat khowajanusrat khowaja 

Lead Validation Rule

Please help me  to create a validation rule for this task. Does this task can be done without tiggers , or the only way is to write tigger for this task."
When a new lead is created, check if there is an Account record that already exists (based on the company name)
if the account exists, then check the box for the field called "active lead" in the Accounts object"

Thanks
Best Answer chosen by nusrat khowaja
007rakeshistom007rakeshistom
@Luke :- Thanks for the Mention! 

@nusrat :- Proposed solution 

Workaround 1 :- If you want to allow your users to create a lead, and then auto update the Account field, then check out this link for step-by-step instructions https://rakeshistom1234-dev-ed.my.salesforce.com/sfc/p/B00000000VTs/a/B00000000FX0/cRqcK898kWd_1XWdbv99JZCWQ.bTKYCfjRlhQSxUZS8

Workaround 2 :- If you don't want to allow your users to create duplicate lead with the same company name, also auto update Account field then follows this article http://wp.me/p1wpoE-ww
 

All Answers

Always ThinkinAlways Thinkin
I referred this question to Rakesh Gupta who writes blog articles on Process Builder (https://rakeshistom.wordpress.com/learning-process-builder/) because this is not a Validation Rule. It could be done with Apex Triggers but it might also be possible with Process Builder - if anyone knows, Rakesh hopefully will! 
007rakeshistom007rakeshistom
@Luke :- Thanks for the Mention! 

@nusrat :- Proposed solution 

Workaround 1 :- If you want to allow your users to create a lead, and then auto update the Account field, then check out this link for step-by-step instructions https://rakeshistom1234-dev-ed.my.salesforce.com/sfc/p/B00000000VTs/a/B00000000FX0/cRqcK898kWd_1XWdbv99JZCWQ.bTKYCfjRlhQSxUZS8

Workaround 2 :- If you don't want to allow your users to create duplicate lead with the same company name, also auto update Account field then follows this article http://wp.me/p1wpoE-ww
 
This was selected as the best answer
nusrat khowajanusrat khowaja
Rakesh could you please help me more, i am badly stuck in this task can not figure out the way to solve it.

I am posting the whole task which is actually consist of two task .you already posted solution for First one .
Could you please help me in second one .

FirstTask:​ When a new lead is created, check if there is an Account record that already exists (based on the company name)
if the account exists, then check the box for the field called "active lead" in the Accounts object
Second Task:When a new opportunity is created (by converting a lead or manually)
then check the box for the field called "active opportunity" in the Accounts object.
at the same time, uncheck the field called "active lead" if its checked.​​

Thanks .​