function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
mromanimromani 

Upsert and Composite Key

I was wondering if it is possible to create composite keys in Salesforce? And if so, how can we utilize this when writing an upsert?

 

For EX: Right now im doing the following to do my upsert:

 

sforce.UpsertResult[] upResult = binding.upsert("Name", objList);

 

but suppose i can have an object with a composite key, how would i do my upsert?

 

Thanks 

mtbclimbermtbclimber

Moved to the general development discussion board.  

 

The upsert method only supports a single field so you'll need to create a field to represent your key and you can use a workflow field update or apex trigger to set the key on save whenever an element of the composite key is updated. 

cesar_perescesar_peres

Using the professional edition I don't have options to do that, have I?