You are here:
InsCensusServiceStd:createUpdateAccounts
Use this service to create Person Accounts for the members in the given census. It also updates the existing person accounts using the duplicateKeys parameter.
Class: InsCensusServiceStd
Method: createUpdateAccounts
Person Accounts must be enabled in the org when using this service.
How it Works
To create person accounts for the members in the given census, this service:
- Retrieves the list of
GroupCensusMemberrecords based oncensusMemberIds. - Creates a Person Account for each
GroupCensusMember. -
The following four fields, along with mapping are copied from
GroupCensusMemberto the Account record.GroupCensusMember Account FirstName FirstName Lastname LastName Email PersonEmail Birthdate PersonBirthdate -
If you provide
duplicateKeysparameter in the input, the service uses the list of comma-separated fields of Account object for identifying the duplicate records. If there is an existing Account record with the same values for these fields, then the service uses the existing Account record. If there is noduplicateKeysparameter, the service creates a new Account record for each census member.-
The fields passed in
duplicateKeysmust be a subset of the fields that are copied to the Account record. If you pass any other fields, they're ignored during duplicate detection.
-
-
Updates the
AccountId and ContactId fields of the census member. -
Sets
GroupCensusMember.AccountId as the ID of the newly created Person Account and GroupCensusMember.ContactIdas the corresponding Contact record. -
The service creates a user record for the
GroupCensusMemberrecords whoseIsPortalUseris true. It usesemailEncoding,localeSID,languageLocale,timeZoneSIDandprofileIdfields to create a User record.
Remote Options
| Option | Description |
|---|---|
censusMemberIds |
Required. List of |
duplicateKeys
|
A string of comma-separated fields of Account object for checking duplicate against existing Account records. Example: |
personAccountRecordType |
Optional. The record type of the person account. If the value isn't passed, it defaults to Person Account. |
emailEncoding |
Required. The encoding format for creating a user record. |
localeSID |
Required. The security identifier of the geographical location. |
languageLocale |
Required. The security identifier of the language. |
timeZoneSID
|
Required. The security identifier of the time zone. |
profileId |
Required. The ID of the profile record that is associated with the user record. |
Output JSON
The output JSON is a list of account Ids of successfully created or update GroupCensusMember records.
Ids of GroupCensusMember records:
{
"censusMemberIds": [
"0r6RO0000000430YAA",
"0r6RO000000042vYAA"
],
"duplicateKeys": "FirstName,LastName"
"emailEncoding": "UTF-8",
"timeZoneSID": "America/New York",
"languageLocale": "en_US",
"localeSID": "en_US",
"profileId": "00eRO000000OUVRYA4",
}Ids of Contact records:
{
"accountIds": [
"003RO000002yi8iYAA",
"003RO000002yi8dYAA"
]
}
