You are here:
InsCensusServiceStd:createContacts
Use this service to create Contacts for census members.
Class: InsCensusServiceStd
Method: createContacts
How It Works
-
The service uses the
censusMemberIds to retrieve all related GroupCensusMemberrecords that don't have a Contact record associated with them. - If the
GroupCensusMemberhas a linked Contact, the service skips it. -
The service creates the Contact and links it into the
GroupCensusMemberrecord. -
The service uses the
duplicateKeysoption to identify duplicates. If there is an existing Contact record with the same values for these fields, the service uses the existing Contact record. When there is noduplicateKeysparameter in the input, the service creates a new Contact record for each census member. -
For each
GroupCensusMemberthe service checks isPortalUser__c field. If its value is true, the service creates a user if it is doesn't exist in the org (based on user email). - The service creates the user based on these required parameters:
emailEncoding, profileId,timeZoneSID, localeSID, andlanguageLocale.
Inputs
Input |
Description |
|---|---|
|
Required. List of group census member Ids to create Contacts. |
Remote Options
Option |
Description |
|---|---|
|
Required. The local language of the user. Example: |
|
Required. Location SID of the user. Example:
|
|
Email encoding type. Example:
|
|
Required. Profile Id of the users to be created Profile Id is the same as User Id. For more info, refer to Find the Salesforce ID for a User or profile . |
|
Time zone SID of user. Example:
|
|
Comma-delimited field names to check for duplicate fields. Example: If not used, the service ignores all duplicate fields. |
Output JSON
The service returns a list of contact Ids of successfully created census members.
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
{
"contactIds": [
"003RO000002yi8iYAA",
"003RO000002yi8dYAA"
]
}
