I have a process that Upserts Account in Salesforce from a third party system, one of the requirements is to be able to change the RecordTypeId between Accounts since our org uses Person Accounts as well as Business Accounts. The current process does not have any special handling for this and simply tries to do a regular upsert resulting in the following error message from Salesforce (When going from a Business Account RecordType to a Person Account RecordType):
OBJ: Account - Cannot specify any additional fields when marrying or separating a Person-Account.
I believe this can be solved by ensuring that the Business Account has exactly one Contact associated to it (https://success.salesforce.com/answers?id=90630000000h1K3AAI), before changing the RecordType. So my plan was to do the following:
- Create a Contact with AccountId of the Business Account.
- Change the RecordType of the Account (Only this in this call).
- Update the remaining fields of the (Person) Account.
What I wonder now is if anyone has done something similar before and can perhaps provide me with a better solution? I could do it in APEX, by using the APEX Connector, but I want to make sure that using that connector is the best way to go before doing it.
So any help and pointers in the right direction is highly appreciated here!