You need to sign in to do that
Don't have an account?
Visithra
I have got stuck in the trigger code,
Please help me with the trigger code for the below scenario,
When an lead is updated status as closed-Not converted, the description field should be entered otherwise it should block the user to update lead.
When an lead is updated status as closed-Not converted, the description field should be entered otherwise it should block the user to update lead.
To implement the desired trigger code, you can use the following Apex trigger for the Lead This trigger fires before the update operation on Lead records. It checks if the lead's status is set to 'Closed - Not Converted'. If it is, it verifies that the description field is not blank. If the description is empty, it adds an error message to prevent the update.
If the status is not 'Closed - Not Converted', it clears the description field to ensure it remains empty.
If this helps , please mark this as Best Answer.
Thank you.