0

I have a C# program that uses the Bulk API to automatically upsert Account records from an external system into Salesforce on a daily basis.

I'd like to be able to change this upsert such that for certain fields (such as BillingStreet), if a destination object already exists AND the object already has a value in that field, the existing value should be kept and NOT overwritten. (However, if there's no value in that field, the value from the external system should be updated into that field as normal.)

Currently, I'm accomplishing this by running an SOQL query to SELECT all of the existing records, and where the BillingStreet value on the existing record is non-empty, setting the record value that gets sent to Salesforce in the Bulk API upsert operation to that existing value from Salesforce, instead of sending the actual value from the external system.

However, I'm not super happy with this approach since it involves an extra, non-trivial call to the Salesforce system before I peform my upsert.

Is there a way in the Bulk API upsert call itself to specify that for certain fields, existing values not be overwritten as existing records are updated? (Or is there another, better way to accomplish what I'm trying to do?)

1 Answer 1

0

You can use before update triggers to detect that your integration user is doing updates and in that case only update those fields if they are still empty.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .