You need to sign in to do that
Don't have an account?

how we can perform upsert operation using trigger ?
Hi All,
i need update the records an contact object, if record is not there then only we need to insert the records using trigger .kindly help me on this .please give me example with functionality.
Thanks in advance
i need update the records an contact object, if record is not there then only we need to insert the records using trigger .kindly help me on this .please give me example with functionality.
Thanks in advance
To upsert a record you need External_Id or key based on which you identify the record is existing to need to create a new record. To achieve the same with Apex code you need to provide the field API name for the same.
Go through the link (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_dml_examples_upsert.htm)provided the exact solution. For short use like this: upsert assets Line_Item_ID__c;
Thanks,
Gaurav Garg
skype: gaurav62990
email: gauravgarg.nmims@gmail.com