How to set Short Description on Approver tab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 02:48 AM - edited 05-07-2024 02:51 AM
Hello!
I am creating 2 different approvals from same request one for onboarding another for system access.
I am able to get the two approvals but the short description for both Approvals is same, I want to keep short description for Onboarding to Onboarding User and for System access to be System access.
How can I do this?
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 02:53 AM - edited 05-07-2024 03:17 AM
Hi @SNewbies ,
You can create a business rule on insert of approval. define right condition and set the short description accordingly.
or you can set the dynamic values in workflow or flow desinger if your creating / generating approval via flow / workflow.
(function executeRule(current, previous /* previous() if it is an async business rule */) {
var requestType = current.u_request_type;
var shortDescription = "";
if (requestType == "Onboarding") {
shortDescription = "Onboarding User";
} else if (requestType == "System Access") {
shortDescription = "System Access";
}
current.short_description = shortDescription;
})(current, previous);
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 03:15 AM
Hi @SNewbies ,
I tried your problem in my PDI and it works for me please create Before Business Rule on Inserted and add below code
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var type = current.u_request_type;
var shortDescription = "";
gs.log("Here Approvals SD = " + current.document_id);
if (type == "backend value onboarding_user") {
gs.log("Here Approvals SD = " + current.document_id);
current.short_description = 'Onbording User';
}if (type == "backendValue of System Acess") {
current.short_description = 'System Access';
}
})(current, previous);
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak