How can I differ between list view and form view in UI action?

asheth
Giga Contributor

We've been using a script that discerns whether a UI action is initiated from the list view or form view. However, recently, "typeof g_list" is returning "object" instead of "undefined" on the form view. Is there an alternative method to determine if it's a list view while on the form view?

 

Is there another way to determine if a call is being from the list view or the form view, other than swapping if and else if to make the function work?

 

 

if (typeof g_list != "undefined") {
        // typeof g_list is Object on both form view and list view so call never enters into else if section
        return g_list.getChecked();
 } else if (typeof g_form != "undefined") {
        return g_form.getUniqueValue();
 }

 

 

 

0 REPLIES 0