Update flag based on conditions from data loaded from file
I am loading data for email addresses from a file and updating its data in EmailAddress Schema which has a link refering to recipient schema, there is a flag primary_email which i have to update based on below conditions and also need to update email data in recipient schema
• If one customer has multiple email addresses, consider the email_verify_status = Yes as primary
email address.
• If there are more than one verified email addresses for a single customer any one email address can
be chosen as primary email address.
• If there is only one email address for the customer, then assign that as the primary email address
irrespective of the email_verify_status flag value
how can this be achieved ?




