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
James FJames F 

Sign-In flow: Check a record if same email already exists. If found, update only. Else, create new record

Hi, 
I am new to SF and right now I am trying to create a new event sign-in flow for the nonprofit I am supporting. I was informed that the flow I want to implement cannot be done using process builder so I am looking for help on how to implement this with Apex trigger.

Requirement:
- New walk-in information is provided (email, first and last name, phone number, company name)
- Check email against existing records in Leads to see if person is already in the system from previously attended events
    ** If an existing record with same email is found, update record with new information (first and last name, phone number, company name)
    ** If not matching record with same email is found, create a new record with new information 

Any suggestion? Thank you.