
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2014 12:32 PM
Hello
I am looking for the alert message that would prevent self approval process in Service Catalog.
I found few scripts online how to display message (and even to clear the name in the field), but it won't break the process. The last update is that I have script that will display alert and delete the approver field regardless of the name.
Any advice and suggestions will be greatly appreciated.
Thank you
Solved! Go to Solution.
- Labels:
-
Service Mapping

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2014 09:46 AM
This is the script. Thank you Scott Peterson
function onSubmit() {
var requester = g_form.getValue('variables.requester');
var reqApprover = g_form.getValue('variables.approver');
if ( reqApprover.toString() == requester.toString() ){
g_form.hideFieldMsg('approver', true);
g_form.showFieldMsg('approver','Approver can not be same as the Requester!','error');
g_form.setValue('variables.approver','');
g_form.getControl('variables.approver').focus();
return false;
}
};

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2014 12:33 PM
This is my script:
function onSubmit() {
if(isLoading)
return;
var approver = g_form.getValue('approver');
//alert('approver ==' + approver);
var requester = g_form.getValue('requester');
//alert('requester ==' + requester);
if(approver == requester){
alert('Requester cannot be the approver at the same time.');
g_form.clearValue('approver');
return false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-10-2014 07:27 PM
Hi Vladimir, what do you want it to do when the requester is the same person that approve that specific catalog item?
Alternatives that I have seen in this case:
1) The request will get automatically approved if requester = approver.
2) If requester = approver alert requester that cannot submit request.
3) if requester = approver approval request will be sent to approver/requester direct manager.
Is that what you are looking for any of these three options?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2014 01:05 PM
Thanks for reply
Option #2 would work fine if I could prevent user to submit request. As I mention, I am able to create alert, but it want stop process.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2014 09:46 AM
This is the script. Thank you Scott Peterson
function onSubmit() {
var requester = g_form.getValue('variables.requester');
var reqApprover = g_form.getValue('variables.approver');
if ( reqApprover.toString() == requester.toString() ){
g_form.hideFieldMsg('approver', true);
g_form.showFieldMsg('approver','Approver can not be same as the Requester!','error');
g_form.setValue('variables.approver','');
g_form.getControl('variables.approver').focus();
return false;
}
};