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','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
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','info@salesforce.com')
| improve this answer | |

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.