Impersonation on my catalog item requested for user should be editable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2025 07:26 AM
Hi Experts
I have catalog item "Order computer" When Impersonate any other user on my catalog item I want my requested by field should editable and If I selected the Impersonate user on the requested by field I should popup the info message.
Example : If I impersonate able tutor and go to catalog item(Order computer) requested by field should be editable and If I select the able tutor it should popup the info message.
Thanks In advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2025 01:06 AM
Hi @dhineshkumar ,
create an onload catalog client script and add this script -
function onLoad() {
//Type appropriate comment here, and begin script below
var ga = new GlideAjax('test');
ga.addParam('sysparm_name', 'getImpersonate');
ga.getXML(updateCampus);
}
function updateCampus(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
if (answer == 'false') {
g_form.setReadOnly('requested_for',true);
} else {
g_form.showFieldMsg('requested_for','test message for abel tutor');
}
}
and then a client callable script include - test
var test = Class.create();
test.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getImpersonate:function(){
return new GlideImpersonate().isImpersonating();
},
type: 'test'
});
Adjust the script as needed to fit your requirements.
If this isn't what you meant, please clarify for me. (See the screenshots please)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2025 01:11 AM
your requirement is not clear.
what script did you try so far and what's not working?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader