Hi,
I created a custom entity called Helpdesk to record requests from our employees. It has a link field called handledby to the User entity and a field called ReqType.
When creating or editing records, I wanted to assign specific users to the handledby field depending on the chosen ReqType.
For example :
If Type is "Payrol Request" it should be assigned to Sheryl
If Type is "Leave Request" it should be assigned to Edward
I created the below code in Formula API Before Save Script of the Helpdesk entity but I could not assign the correct user. Please help.
Thanks in advance...
I created a custom entity called Helpdesk to record requests from our employees. It has a link field called handledby to the User entity and a field called ReqType.
When creating or editing records, I wanted to assign specific users to the handledby field depending on the chosen ReqType.
For example :
If Type is "Payrol Request" it should be assigned to Sheryl
If Type is "Leave Request" it should be assigned to Edward
I created the below code in Formula API Before Save Script of the Helpdesk entity but I could not assign the correct user. Please help.
Code:
$prevType = entity\attributeFetched('reqtype');
if (reqtype != $prevType) {
if (reqtype == 'Payroll Request') {
userName = 'Sheryl Adams';
userId = 'sadams';
}
if (reqtype == 'Leave Request') {
userName = 'Edward Adams';
userId = 'eadams';
}
}
Thanks in advance...

Comment