
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2016 07:08 AM
Hi,
I have a Client UI Action that is available both as a form button and a list context menu.
What I' having trouble with is the gsftSubmit() function and any of the g_form functions are not available if run from e.g. a related list.
Do you guys (and gals) have any ideas how I might check from where the UI Action was triggered?
typeof rowSysId returns a value in both cases, so no use
g_form === undefined also does not seem to work.
I would like to write an if block so that if the UIA is triggered from a list it will run different client code than from a form.
Any help much appreciated,
Thanks!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2016 07:11 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2016 07:11 AM
You could just check the url of the frame for _list.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2016 11:26 PM
Right, haven't thought of that. thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2017 09:13 AM
Hello Tomaz,
Though it seems you already have a solution, just wanted to share what I did for similar situation where I need to detect if a UI Action is fired from List Context or Form.
After lot of searching in Wiki and Community posts, I came up with below script to check and perform actions based on it:
gURI = action.getGlideURI();
var isList = gURI.get('sys_is_list');
var isRelList = gURI.get('sys_is_related_list');
if(isList || isRelList){
perform list actions; //only if UI Action is fired from list or related list context menu
}else{
perform form actions; //only if UI Action is fired from form view
}
Hope this helps!
Regards,
Santhosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2022 08:52 AM
Thank you for this post from five years ago. It has really helped me today! This works great and is exactly what I need.