- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2023 09:16 PM
Hi All,
I have a requirement to pop up confirm if you have to reject the form and two choices should be there in pop up as yes or no if they select as change to reject status else previous status only be set. Please do share what needs to be done for this and if any scripting required please help on that as well.
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2023 09:37 PM
Hi @Kruthik M Shiva ,
Kindly refer below code to achieve your requirement.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if(newValue == 'rejected'){ // please use proper backend name of the reject status
var answer = confirm('Do you wish to proceed with Rejecting the change');
if(!answer){
return false;// this will not allow the user to save the form with reject status
}
}
}
Please mark my answer helpful & accepted if it helps you resolve your issue.
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 05:12 AM
Can you attach screen shot, what you have done so far, and what errors you get.. It may helpful to answer the query.
Thank you
Thank you
G Ramana Murthy
ServiceNow Developer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 05:22 AM
Hi @RAMANA MURTHY G
In the native view its working fine whereas in portal view I am getting JavaScript error for the same code. Ideally in my case the user will be changing the status in portal view only please do let me know the reason and solution if any for this.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 11:15 PM
What error exactly you get, it will be more helpful if u provide any screenshots of what you are done so far, what error you get
Thank you
Thank you
G Ramana Murthy
ServiceNow Developer