You need to sign in to do that
Don't have an account?
gokubi
Triggers: creating related objects
Before a Contact is created I want to see if it has been related to an existing Custom Object called "ONEN_Household__C". If it hasn't, I want to create that Custom Object, then get the id of the new object, creating the Contact with that reference recorded.
Here's what I've got so far:
Code:
Thanks!
Steve
Here's what I've got so far:
Code:
trigger HouseholdCheck on Contact bulk (before insert) { for (Contact c : Trigger.new) { if (c.ONEN_Household__c == NULL) { c.Description='No Household'; insert new ONEN_Household__c (Name=c.firstname + ' ' + c.lastname + ' Household'); } } }After I do the insert new ONEN_Household__C, how do I get that new object's Id?
Thanks!
Steve
Thanks!