Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Salesforce Create account failing

AshirvadhN
Regular Contributor
Regular Contributor

Hi Team,

Am not able to create the account in Salesforce.

It is showing me this error "Error in user creation = Cannot get property 'errorCode' on null object" in Pending tasks Provisioning comments. Please help me.

All the saviynt attributes have data in user, none of them are empty.

Below is the Account field query

Id,Username,LastName,FirstName,Name,CompanyName,Email,IsActive,UserRoleId,ProfileId,UserType,ManagerId,LastLoginDate,LastPasswordChangeDate,CreatedDate,CreatedById,LastModifiedDate,LastModifiedById,SystemModstamp, ContactId,AccountId,FederationIdentifier,UserPermissionsSupportUser

 

Below is the Create account json.

{
"Username": "${user.email}",
"Alias": "${user.firstname.toString().substring(0,1)}${user.lastname.toString().substring(0,4)}",
"LastName": "${user.lastname}",
"FirstName": "${user.firstname}",
"CompanyName": "${user.orgunitid}",
"Department": "${user.departmentname}",
"Title": "${user.title}",
"Street": "${user.street}",
"City": "${user.city}",
"State": "${user.state}",
"PostalCode": "${user.customproperty19}",
"Country": "${user.country}",
"Email": "${user.email}",
"EmailPreferencesAutoBcc": true,
"EmailPreferencesAutoBccStayInTouch": false,
"EmailPreferencesStayInTouchReminder": true,
"Phone": "${user.secondaryPhone}",
"MobilePhone": "${user.phonenumber}",
"CommunityNickname": "${user.lastname}",
"IsActive": true,
"TimeZoneSidKey": "America/New_York",
"LocaleSidKey": "en_US",
"ReceivesInfoEmails": true,
"ReceivesAdminInfoEmails": true,
"EmailEncodingKey": "ISO-8859-1",
"LanguageLocaleKey": "en_US",
"EmployeeNumber": "${user.employeeid}",
"ProfileId":"${profileId}",
"UserPermissionsMarketingUser": false,
"UserPermissionsOfflineUser": false,
"UserPermissionsAvantgoUser": false,
"UserPermissionsCallCenterAutoLogin": false,
"UserPermissionsMobileUser": false,
"UserPermissionsSFContentUser": false,
"UserPermissionsInteractionUser": false,
"UserPermissionsSupportUser": false,
"ManagerId": "${ if (managerAccount == null || managerAccount?.accountID == null || managerAccount?.accountID == '' ){''} else {managerAccount?.accountID} }", "ContactId": "${user.customproperty26}","FederationIdentifier": "${user.email}",
"Working_Hours__c": null,
"SECO_Flag__c": false
}

5 REPLIES 5

rushikeshvartak
All-Star
All-Star

Could you kindly provide a detailed snapshot of the information extracted from the logs, encompassing errors and other pertinent functionality details encountered during the execution of this process? Your assistance in furnishing this information would greatly aid in the analysis and resolution of any issues .



‼️‼️⚠️Do not upload any attachments that contain sensitive information, such as IP Addresses, URLs, Company/Employee Names, Email Addresses, etc.⚠️‼️‼️


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

AshirvadhN
Regular Contributor
Regular Contributor

Hi @rushikeshvartak 

Please find the attached Logs file.

Does user have all attribute ? It seems mandatory attribute is being sent blank to salesforce

{
"Username": "${user?.email}",
"Alias": "${user?.firstname.toString().substring(0,1)}${user?.lastname.toString().substring(0,4)}",
"LastName": "${user?.lastname}",
"FirstName": "${user?.firstname}",
"CompanyName": "${user?.orgunitid}",
"Department": "${user?.departmentname}",
"Title": "${user?.title}",
"Street": "${user?.street}",
"City": "${user?.city}",
"State": "${user?.state}",
"PostalCode": "${user?.customproperty19}",
"Country": "${user?.country}",
"Email": "${user?.email}",
"EmailPreferencesAutoBcc": true,
"EmailPreferencesAutoBccStayInTouch": false,
"EmailPreferencesStayInTouchReminder": true,
"Phone": "${user?.secondaryPhone}",
"MobilePhone": "${user?.phonenumber}",
"CommunityNickname": "${user?.lastname}",
"IsActive": true,
"TimeZoneSidKey": "America/New_York",
"LocaleSidKey": "en_US",
"ReceivesInfoEmails": true,
"ReceivesAdminInfoEmails": true,
"EmailEncodingKey": "ISO-8859-1",
"LanguageLocaleKey": "en_US",
"EmployeeNumber": "${user?.employeeid}",
"ProfileId":"${profileId}",
"UserPermissionsMarketingUser": false,
"UserPermissionsOfflineUser": false,
"UserPermissionsAvantgoUser": false,
"UserPermissionsCallCenterAutoLogin": false,
"UserPermissionsMobileUser": false,
"UserPermissionsSFContentUser": false,
"UserPermissionsInteractionUser": false,
"UserPermissionsSupportUser": false,
"ManagerId": "${ if (managerAccount == null || managerAccount?.accountID == null || managerAccount?.accountID == '' ){''} else {managerAccount?.accountID} }", "ContactId": "${user?.customproperty26}","FederationIdentifier": "${user?.email}",
"Working_Hours__c": null,
"SECO_Flag__c": false
}

Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Raghu
All-Star
All-Star

@AshirvadhN  check token once again


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

SumathiSomala
All-Star
All-Star

@AshirvadhN 

Error message from logs: "2024-06-11T15:43:09.772+00:00","ecm-worker","provisoning.SalesForceProvisioningService","quartzScheduler_Worker-4","DEBUG","*** Error in creating user = String index out of range: 3"

This error may come when lastname less than 4 characters

please find the below logic for Alias. Please make the necessary changes as per your requirement.

"Alias": "${if(user?.lastname!=null && user?.lastname.length()>=4){user?.firstname.toLowerCase().substring(0,1)+user?.lastname.toLowerCase().substring(0,4)}else if(user?.lastname!=null && user?.lastname?.length()<4){user?.firstname.toLowerCase().substring(0,1)+user?.lastname.toLowerCase()}}"

 

Regards,
Sumathi Somala

If this reply answered your question, please Accept As Solution and give Kudos.