- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2023 08:57 AM
Hi All,
Over the UI Action, I m not able to fully put my condition in the condition field .
(current.state < 3 && current.approval != 'requested' && !current.change_request.on_hold && current.u_external_ticket_number=='' && current.u_external_ticket_system_id=='') ||(current.u_external_ticket_number!='' && current.u_external_ticket_system_id!='' &&gs.getUserhasRole('admin'))||
(current.u_external_ticket_number!='' && current.u_external_ticket_system_id!='' &&gs.getUserhasRole('change_manager'))
Please someone help me letting know how can this be placed.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2023 09:55 AM
In the filter Navigator -> script Include -> Under Definition(script include).
As mentioned in above screenshot, Please write your function in script include as mentioned:
HideUIAction:function(ref){
if((ref.state < 3 && ref.approval != 'requested' && !ref.change_request.on_hold && ref.u_external_ticket_number=='' && ref.u_external_ticket_system_id=='') ||(ref.u_external_ticket_number!='' && ref.u_external_ticket_system_id!='' &&gs.getUserhasRole('admin'))||
(ref.u_external_ticket_number!='' && ref.u_external_ticket_system_id!='' &&gs.getUserhasRole('change_manager'))){
return true
}else
return false;
},
In the UI action please call this script include using
new scriptIncludeName.functionName() == "true";
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful based on the Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2023 09:04 AM
I believe "condition" is the field of OOB table and its not the best practice to update the size, you can try with this method:
Calling the script include - new scriptInclude().functionName(current) == true;
In the script include you can mention your conditions and return true or false accordingly!
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful based on the Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2023 06:20 PM
I am new to script include. Could you please help me how to put those conditions in script include and call it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2023 09:55 AM
In the filter Navigator -> script Include -> Under Definition(script include).
As mentioned in above screenshot, Please write your function in script include as mentioned:
HideUIAction:function(ref){
if((ref.state < 3 && ref.approval != 'requested' && !ref.change_request.on_hold && ref.u_external_ticket_number=='' && ref.u_external_ticket_system_id=='') ||(ref.u_external_ticket_number!='' && ref.u_external_ticket_system_id!='' &&gs.getUserhasRole('admin'))||
(ref.u_external_ticket_number!='' && ref.u_external_ticket_system_id!='' &&gs.getUserhasRole('change_manager'))){
return true
}else
return false;
},
In the UI action please call this script include using
new scriptIncludeName.functionName() == "true";
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful based on the Impact.