Note: I am a fairly new apex developer so I apologize if this is a basic question.
I'm working on an apex trigger which will prevent a contact from being created when there is an existing lead with the same email address and vice versa.
The trigger itself works, but I have discovered that it results in not being able to convert leads. It appears as though the first step in the lead conversion process is to create a new contact with all the same information as the lead. This step ends up being blocked by my trigger. At this step in the process the lead has yet to be marked with IsConverted = true so that can't be used as a distinguisher.
It appears that the trigger isn't able to access any information about the page which initiated it so I'm not able to use that either.
Is there any way around this or am I better off turning the trigger and just accepting that there may be contacts and leads with the same email?