1

Has anyone been able to use the UpdateSingleSalesforceObject function on an Account/Contact in Person Accounts (specifically Contact fields such as Email, FirstName, LastName)? I'm able to retrieve the contact using RetrieveSalesforceObjects but I obviously can't write to Contacts as it is read-only on Person Accounts.

I've tried replacing "Email" below with "Account.PersonEmail", "PersonEmail", "Email__pc". None of the above works.

set @result = UpdateSingleSalesforceObject('Account','0031U00000KE9UTQA1','Email','[email protected]')
4
  • 1
    You are specifying 'Account' as object, but using Contacts ID as the specified ID in your call (starting with 003). You should specify the object type as Contact. Never heard Contacts being read-only for PersonAccounts. If I'm not wrong the Email field is just called "PersonEmail".
    – Rain
    Commented Apr 15, 2019 at 21:37
  • I’ve also tried the AccountId and PersonContactId but to no avail. The issue is that the AMPscript function only can update objects and PersonAccount is not an object. Commented Apr 15, 2019 at 21:46
  • 1
    "In the newer APIs, the Contact is completely read-only if it is attached to an account (as in, a Person Account). Instead, use the same field on the account, and update that instead." developer.salesforce.com/forums/?id=906F00000008xrHIAQ Commented Apr 15, 2019 at 22:51
  • Thanks @Rain for the help. "PersonEmail" is correct. There were some validation errors in SalesCloud on some formulas which was causing the record to not update. Commented Apr 16, 2019 at 1:28

1 Answer 1

1

Turns out there were some formula validation errors on SalesCloud which prevented any updates to the Person Account record. The correct AMPscript is:

set @result = UpdateSingleSalesforceObject('Account',@PersonContactId,'PersonEmail','[email protected]')
3
  • did you get this to work with a contact ID where you have @PersonContactId? I can only get it to work with an actual account ID, but not with the PersonContactID Commented Oct 26, 2020 at 16:32
  • Make sure you’re updating on the Account object. Commented Oct 26, 2020 at 16:50
  • I was, but no dice. I'll try again. Commented Oct 27, 2020 at 14:04

You must log in to answer this question.

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