+ Start a Discussion
Mohammadasif SiddiquiMohammadasif Siddiqui 

Create a trigger to check if the account name exists while creating a lead if the record exists then create a new case with the subject account name already exists.

I have below Task to complete, can anyone provide me its code.

Create a trigger to check if the account name exists while creating a lead if the record exists then create a new case with the subject account name already exists. 

Please Help me.

Thanks in Advance

ShirishaShirisha (Salesforce Developers) 
Hi Mohammadasif.

Greetings!

It is not possible to provide the exact code,however you can check the sample code for existing records and create new if it doesn't find any.

Please check the sample code here:

https://salesforce.stackexchange.com/questions/142622/how-to-add-an-account-if-doesnt-exist-from-a-trigger-on-lead

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Warm Regards,
Shirisha Pathuri