and more in a single search tool across platforms. Read the announcement here. |
12/01/2023 12:23 AM
Hi Team,
we have the sam account name logic as below , but due the same if there is a space in the name for eg first name John Last Name S M then the sam Account name is getting created with space to over come the same we have implemented the below logic , but the add account task is getting failed with error as below .
Sam Account name logic --
ln = user.displayname.trim().toLowerCase();
ln = user.lastname.trim().toLowerCase();
ln = user.displayname.replaceAll("\\s","").trim().toLowerCase();
ln = user.lastname.replaceAll("\\s","").trim().toLowerCase();
Error in Provisioning new account --
Error while creating account in AD - Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed: SimpleTemplateScript455.groovy: 7: unexpected char: '\' @ line 7, column 35. ln = user.displayname.replaceAll(\\\s\,\"\").trim().toLowerCase(); ^ 1 error
12/05/2023 06:59 AM
Hi @Aparna
Please try replacing replaceAll("\\s","") with replaceAll('\\s','') everywhere and check if it works.
Regards,
Dhruv Sharma
If the response is helpful, please click Accept As Solution and kudos it.
12/14/2023 03:19 AM
Hi Dhruv,
Thanks will check the solution and post if any issue .
12/14/2023 06:43 AM
@Aparna can you try :
ln = user.displayname.replaceAll('\\s',"").trim().toLowerCase();
ln = user.lastname.replaceAll('\\s',"").trim().toLowerCase();