Click HERE to see how Saviynt Intelligence is transforming the industry. |
06/11/2024 02:20 AM
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
}
06/11/2024 05:29 AM
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.⚠️‼️‼️
06/11/2024 08:47 AM
06/12/2024 10:01 PM
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
}
06/12/2024 10:59 AM
@AshirvadhN check token once again
06/13/2024 02:26 AM
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()}}"