You need to sign in to do that
Don't have an account?
Jacob W Landis
If existig do update in trigger
Hi,
we have a scheduled job running every hour which import a list data of a custom object from other system to salesforce. We want to have a trigger to check whether the data is existing or not, if it is existed, we want to update the existing record. how should I implement this?
Jingli
we have a scheduled job running every hour which import a list data of a custom object from other system to salesforce. We want to have a trigger to check whether the data is existing or not, if it is existed, we want to update the existing record. how should I implement this?
Jingli
Try using the Upsert functionality in Salesforce. If you are storing Salesforce ID or any form of External ID, then upsert does exactly as you want.
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_calls_upsert.htm
The scheduled job should not insert/update and should do an upsert with a secific field as external ID. This could be a workflow populated field with combination of field values as well.
Hope this helps!