- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2022 08:41 AM
I have a GlideDialogForm popup for the customer_contact form that I want to display in a certain view. When I run it as an admin, it opens correctly in the view I set regardless of what view I have last viewed the form in. When I run it as a user it opens in the last view (possibly their preference view) they viewed the customer_contact form in. They do have access to set their view to the one I want to open as if they are on the form. To set the view, I run this before rendering it:
dialog.addParm('sysparm_view', 'Requestor2');
Why is this only working as an admin?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2022 10:57 AM
Weird that should have forced the view do you have avy view rules can uou check once?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2022 09:50 AM
Hello,
Can you paste some screenshots then it would be easier to assist you.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2022 10:06 AM
Sure, I have a UI action called 'Create Contact'. When I click that, this GlideDialogForm opens up and it opens in the 'Requestor2' view as it should.
Now when I do the exact same thing while impersonating a user that is not an admin, it opens the customer_contact form in the last view that they used on the page. 'case' view in this example.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2022 10:29 AM
Hello,
Can you use the below:-
d.addParm("sysparm_view", "Requestor2");
d.addParm("sysparm_view_forced", true);
Please mark answer correct/helpful based on Impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2022 10:38 AM
Unfortunately that didn't work. Still opens as the 'case' view for users without admin. Any other ideas? Here is what I have for the popup right now:
var dialog = new GlideDialogForm('Create Contact', 'customer_contact', contactCallback);
dialog.setTitle('Create Contact');
dialog.addParm('sysparm_view', 'Requestor2');
dialog.addParm('sysparm_form_only', 'true');
dialog.addParm('sysparm_view_forced', 'true');
dialog.setLoadCallback(function(iframeDoc) {
// To get the iframe: document.defaultView in non-IE, document.parentWindow in IE
var dialogFrame = 'defaultView' in iframeDoc ? iframeDoc.defaultView : iframeDoc.parentWindow;
dialogFrame.addLoadEvent(function() {
dialogFrame.g_form.setValue('first_name', fname);
dialogFrame.g_form.setValue('last_name', lname);
dialogFrame.g_form.setValue('email', g_form.getValue('u_email'));
dialogFrame.g_form.setValue('phone', g_form.getValue('u_phone'));
dialogFrame.g_form.setValue('user_name', g_form.getValue('u_email'));
dialogFrame.g_form.setValue('account', g_form.getValue('u_account'));
});
});
dialog.render();
(Also, for testing purposes I commented out the setLoadCallback and it still doesn't work)