0

I have a webform in Cloud Pages that, upon submission, will do a few things. One of those things is to update the Lead's Owner to be one of several different queues.

The relevant code:

SET @ownerID = "00G0L0000042FX7"
SET @salesforceUpdate = UpdateSingleSalesforceObject("lead", LongSFID(@SubscriberKey),
                   "FirstName"                     , @FirstName, 
                   "LastName"                      , @LastName, 
                   "MobilePhone"                   , @Phone, 
                   "NVMConnect__NextContactTime__c", @NextContactTime, 
                   "Owner"                         , @ownerID)

The response when I catch the exception thrown is:

Call to update the salesforceobject lead ID = 00Q0L00001H6FE6UAN failed! Error status code: INVALID_FIELDError message: The external foreign key reference does not reference a valid entity: Owner

The @ownerId is definitely the ID of the queue image of url

0

1 Answer 1

2

If the OwnerID is definitely the ID of the queue, then it must be column naming in the function call, I noticed you have Owner as the column name but it should be OwnerId according to the salesforce documentation.

SET @ownerID = "00G0L0000042FX7"
SET @salesforceUpdate = UpdateSingleSalesforceObject("lead", LongSFID(@SubscriberKey),
               "FirstName"                     , @FirstName, 
               "LastName"                      , @LastName, 
               "MobilePhone"                   , @Phone, 
               "NVMConnect__NextContactTime__c", @NextContactTime, 
               "OwnerId"                         , @ownerID)

Here is a screenshot from the documentation for proof

enter image description here

Hope this helps.

1
  • Not a problem, happy to help! Aug 3, 2017 at 1:59

You must log in to answer this question.

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