- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2017 12:58 AM
When RITM is in 'waiting_for_approval' state, I need to hide new and edit button, Am writing below script, Which is resulting in hiding buttons in all state.
I tried using parent.stage='waiting_for_approval' and parent.stage=='waiting_for_approval'.
please suggest me what am doing wrong?
script:
----------------
var answer;
if((parent.assigned_to!=gs.getUserID()) || (!parent.active)||(parent.stage='waiting_for_approval')){
answer=true;
}
else{
answer=false;
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2017 01:31 AM
OK. Please update your code as below:
Script:
if(parent.stage=='waiting_for_approval')
{
answer=true;
}
else if(parent.stage!='waiting_for_approval' && parent.assigned_to==gs.getUserID())
{
answer=true;
}
It's working for me on my Personal instance.Please find the scenarios I have tested as per your requirement.
Scenario 1: When the Stage of RITM is Waiting For Approval irrespective of Assigned To, the New button is made hidden irrespective of Assigned To. Please see the screen shot below:
Scenario 2: When the Stage is Not Waiting For Approval and say any other stage and now we are checking if the Assigned to User is same as Logged in User or not. If they are same we are again hiding the New Button. Please see the screenshot below:
I have logged in as System Administrator which is same as Assigned To so the New button is now not visible.
Scenario 3: Now when the stage is anything except Waiting for Approval and Assigned To is also not same as Logged in User which is your Third scenario so the New button would again be visible as shown below:
In the above screen shot I have again logged in as System Administrator and Assigned To is Abel Tuter, so now the New Button is visible.
Hope this helps.Mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2017 01:31 AM
OK. Please update your code as below:
Script:
if(parent.stage=='waiting_for_approval')
{
answer=true;
}
else if(parent.stage!='waiting_for_approval' && parent.assigned_to==gs.getUserID())
{
answer=true;
}
It's working for me on my Personal instance.Please find the scenarios I have tested as per your requirement.
Scenario 1: When the Stage of RITM is Waiting For Approval irrespective of Assigned To, the New button is made hidden irrespective of Assigned To. Please see the screen shot below:
Scenario 2: When the Stage is Not Waiting For Approval and say any other stage and now we are checking if the Assigned to User is same as Logged in User or not. If they are same we are again hiding the New Button. Please see the screenshot below:
I have logged in as System Administrator which is same as Assigned To so the New button is now not visible.
Scenario 3: Now when the stage is anything except Waiting for Approval and Assigned To is also not same as Logged in User which is your Third scenario so the New button would again be visible as shown below:
In the above screen shot I have again logged in as System Administrator and Assigned To is Abel Tuter, so now the New Button is visible.
Hope this helps.Mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2018 09:25 AM
guys, I need to hide the task_ci (affected Cis) button into the change_task, is there anything to use something like sub_parent?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2018 09:28 AM
I got it, you need to use parent.parent, thanks!