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
Sam1980Sam1980 

only ONE salesperson per lead

I have created a form  ( Leads) where the data gets inserted .

Every Lead will have a Unique Lead ID.

I have another form where i add salesperson under that Lead, so in the drop down first lead is selected then the data of salesperon is added.

My question is i want to Add only ONE salesperson per lead.

So how do i manage this what is the best approach ? To show validation error that you have already added a salesperson... under LEADID.

Any code?
Best Answer chosen by Sam1980
praveen murugesanpraveen murugesan
Hi Sach,

If I under stood your question correctly,

use one query in save method or trigger. which extract salesperson's record which having selected lead id.

If that query is not null then add a message in page.

Mark this as best answer if its helps.

Thanks

Praveen Murugesan

All Answers

AshlekhAshlekh
Hi,

You can write a triigger by which you can get the information of lead and associated salesforce person. if that lead have alredy assign to any sales percon than it throw an error msg. 
praveen murugesanpraveen murugesan
Hi Sach,

If I under stood your question correctly,

use one query in save method or trigger. which extract salesperson's record which having selected lead id.

If that query is not null then add a message in page.

Mark this as best answer if its helps.

Thanks

Praveen Murugesan
This was selected as the best answer