Click HERE to see how Saviynt Intelligence is transforming the industry. |
04/02/2024 05:32 AM
Hi,
I am writing the logic in createaccountJSON, getting the below error. Could someone suggest me the right logic.
"erp-compcode": "${ if (user.customproperty20=='TVN' || user.customproperty20=='Workday') {user.customproperty14 anyof ['249', '898', '888', '885', '766', '850', '849', '851', '852']}}",
While creating the AD Account got the below error.
Error while creating account in AD - No such property: anyof for class: SimpleTemplateScript11052
Thanks,
Ravi.
04/03/2024 09:48 PM
Please try with below. anyof method is not supported by code.
"erp-compcode": "${ if (user.customproperty20=='TVN' || user.customproperty20=='Workday') {user.customproperty14='249' || user.customproperty14='898' || user.customproperty14='888' || user.customproperty14='885' || user.customproperty14='766' || user.customproperty14='850' || user.customproperty14='849' || user.customproperty14='851' || user.customproperty14='852'}}",
Regards,
Dhruv Sharma
04/05/2024 04:08 AM
Hi Dhruv,
I have tried the logic which was shared by you getting the below error.
"erp-compcode": "${ if (user.customproperty20=='TVN' || user.customproperty20=='Workday') {user.customproperty14=249 || user.customproperty14=898 || user.customproperty14=888 || user.customproperty14=885 || user.customproperty14=766 || user.customproperty14=850 || user.customproperty14=849 || user.customproperty14=851 || user.customproperty14=852}}",
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: SimpleTemplateScript228.groovy: 39: (249 || user.customproperty14) is a binary expression, but it should be a variable expression at line: 39 column: 148. File: SimpleTemplateScript228.groovy @ line 39, column 148. '249' || user.customproperty14='898' || ^ 1 error
Thanks,
Ravi.
04/05/2024 08:27 AM
@Ravi : What is the actual if condition you are looking for? If user.customproperty14 is also your if condition then change the logic like below
"erp-compcode": "${ if (user.customproperty20=='TVN' || user.customproperty20=='Workday' || user.customproperty14=249 || user.customproperty14=898 || user.customproperty14=888 || user.customproperty14=885 || user.customproperty14=766 || user.customproperty14=850 || user.customproperty14=849 || user.customproperty14=851 || user.customproperty14=852){ <<logic when if condition is true>> }}",
04/10/2024 10:19 AM
Hi Saathvik,
Customproperty20 or condition satisfied then print the customproperty14 to filter and print any of this number '249', '898', '888', '885', '766', '850', '849', '851', '852'.
Thanks,
Ravi.