- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2018 08:15 AM
Hi, Following unload script is not working on new Portal. I tried to use GlidAjex and realized GlideAjex is not supporting portal too. does getRefrence also not support portal??
function onLoad() {
//Type appropriate comment here, and begin script below
var supervisorRef = g_form.getReference('bulkmail_supervisor_name', popSupervisorInfo);
function popSupervisorInfo(supervisorRef) {
if (supervisorRef.phone) {
g_form.setValue('bulkmail_supervisor_phone', supervisorRef.phone);
}
}
Thank you!
Dilini
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2018 10:51 AM
If you run this do you see an alert with the supervisor name?
function onLoad() {
// Query for the supervisor
var supervisorRef = new GlideRecord('sys_user');
supervisorRef.addQuery('sys_id', g_form.getValue('bulkmail_supervisor_name'));
supervisorRef.query(popSupervisorInfo);
}
function popSupervisorInfo(supervisorRef) {
if (supervisorRef.next()) {
alert('Supervisor: ' + supervisorRef.name);
if (supervisorRef.phone) {
g_form.setValue('bulkmail_supervisor_phone', supervisorRef.phone);
}
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2018 01:47 PM
The script you just offered isn't an alternate solution. It is the solution I already offered with different variable names. It's true that you CAN hijack people's threads, but it's incredibly rude and usually confuses the issue. The link you're referencing (where you imply that I do the same thing you're doing here) is about the 3rd time that person posted the exact same issue (the first 2 of which I responded to with a similar answer). I wasn't hijacking anything, I was reinforcing a point I had already made.
You can continue to do what you want but the mess here in this thread speaks for itself.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2018 01:57 PM
I replied after an hour when there was no other response from anybody. And all I wanted is to help people get their answer quickly.
I definitely see you making a mess. But I have no problem with it.
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2018 02:52 PM
Above scrip doesn't work too. rec object is not passed to call can function.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2018 03:08 PM
The variable 'bulkmail_supervisor_name', is it pointing to the user table?
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2018 03:10 PM
Yes. us_user table.