Violation of PRIMARY KEY constraint 'PK_CustCnAttr'. Cannot insert duplicate key in object 'Erp.CustCnAttr'

I think I’ve got a different version of the problem discussed in https://www.epiusers.help/t/updating-or-adding-new-custcnt-with-custcnattr/99868 but haven’t been able to find a solution.

This is a screen shot of the kinetic function that I’m calling from a data directive BPM.

The purpose of this function is to send new contacts and contact updates to Salesforce and if it was a new contact then the SalesforceID is written back to CustCnt.SalesforceID_c.

In the Get CustCnt step, I am using the Erp.CustCnt GetByID method to retrieve the CustCnt record I want to update. That record is retrieved into a CustCnt tableset called dsCustCnt.

If this was a new contact sent to Salesforce, then an Update Table by Query widget (Update dsCustCnt) sets the RowMod field to “U”, and the SalesforceID_c field to a variable value returned from the Call Rest API step. I’ve tried the following bindings of AttrCodeList field -
-ignore
-field: dsCustCnt_CustCnt_AttrCodeList
-expr:“”

Regardless of what I do with the AttrCodeList field, when I call use the Invoke BO Method widget to call the Erp.CustCnt.Update BO method I get the Pkey violation error.

To make sure I wasn’t getting a misleading error, I have deleted the record in CustCnAttr for the contact I am testing with. The Update method runs without error then and a new record is created in CustCnAttr for the contact.

I’m out of ideas.
Mad Looney Tunes GIF by MOODMAN

What are you setting CustCnt.AttrCodeList too?

I’ve tried binding it to the current value of the field and I’ve tried setting it to the expression of “”.

I’m not trying to add any attribute value.

Might be easier to delete and recreate everytime.

Big Plays Workout GIF by Patrick Paige II

I’ve been trying to implement this is a supported manner, but may have to resort to “Update CustCnt set SalesforceID_c to…”