Skip to main content
Steve Tibbett (Snapclarity Inc.) 님이 #Integration에 질문했습니다
I have a few thousand contacts and we're switching to Person Accounts since we're essentially a B2C company.

I'm writing a migration script using the API. I have a particular Contact, and I want to create a new PersonAccount associated with that contact.

I've tried just creating the account with the PersonAccountId value set to the contact's Id, but that gives me an error.

 

conn.sobject("Account").create({

FirstName: contact.FirstName,

LastName: contact.LastName,

PersonAccountId: contact.Id

});

That gets me 

INVALID_FIELD_FOR_INSERT_UPDATE: Unable to create/update fields: PersonContactId

I can see the PersonContactId field in the Account when I query it, but I guess it's read only.

What's the proper way to do this?

Thanks

 -- Steve

 
답변 1개
  1. 2020년 3월 10일 오후 8:19

    Sorry, the code block should be:

    conn.sobject("Account").create({

    FirstName: contact.FirstName,

    LastName: contact.LastName,

    PersonContactId: contact.Id

    });