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','info@salesforce.com')
  • 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 Apr 15 '19 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. – Jackson Chen Apr 15 '19 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 – Jackson Chen Apr 15 '19 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. – Jackson Chen Apr 16 '19 at 1:28

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','info@salesforce.com')
  • 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 – garek007 Oct 26 '20 at 16:32
  • Make sure you’re updating on the Account object. – Jackson Chen Oct 26 '20 at 16:50
  • I was, but no dice. I'll try again. – garek007 Oct 27 '20 at 14:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.