You need to sign in to do that
Don't have an account?
vinni shree
Insert or Upsert
Hi,
I have one custom object now when user creates record it should be inserted in the custom object and it should relate to the existing contact and this contact has one external ID field so this custom record should relate it to the external ID filed now should I use insert followed by an update or can I use upsert on the custom object by specifying the relationship of external object.
Thank you
I have one custom object now when user creates record it should be inserted in the custom object and it should relate to the existing contact and this contact has one external ID field so this custom record should relate it to the external ID filed now should I use insert followed by an update or can I use upsert on the custom object by specifying the relationship of external object.
Thank you
You can use upsert operation to insert a new record in the custom object and relate it to an existing contact using the external ID field.
When using upsert, you can specify the external ID field and its value for the related contact object in the external ID mapping of the custom object. This will ensure that the new record is related to the correct contact based on its external ID value.
Using insert followed by an update can also achieve the same result, but it would require two separate API calls and may not be as efficient as using upsert.
If the above information helps , please mark this as Best Answer.
Thank you.
All Answers
You can use upsert operation to insert a new record in the custom object and relate it to an existing contact using the external ID field.
When using upsert, you can specify the external ID field and its value for the related contact object in the external ID mapping of the custom object. This will ensure that the new record is related to the correct contact based on its external ID value.
Using insert followed by an update can also achieve the same result, but it would require two separate API calls and may not be as efficient as using upsert.
If the above information helps , please mark this as Best Answer.
Thank you.