You need to sign in to do that
Don't have an account?

Relationship between a User account and a Person account
My JIT code creates one User object u and another Person Account object with accountId ID. (my environment uses person accounts). I need to establish a relationship between them and I believe this has to be done using a command like:
u.ContactId = [select PersonContactId FROM account where ID =: accountId].Id
However, I am getting the next error at the insert command:
10:34:29:496 FATAL_ERROR System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, Contact ID: id value of incorrect type: 0015500000Es8udAAB: [ContactId]
Can someone please tell me what am I missing?
Thanks Jose
u.ContactId = [select PersonContactId FROM account where ID =: accountId].Id
However, I am getting the next error at the insert command:
10:34:29:496 FATAL_ERROR System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, Contact ID: id value of incorrect type: 0015500000Es8udAAB: [ContactId]
Can someone please tell me what am I missing?
Thanks Jose
u.ContactId = [select PersonContactId FROM account where ID =: accountId].PersonContactId;
and the error ended