Displaying UI Action only on related list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-10-2015 03:30 AM
Hi,
I'm trying to create a client side UI action (List banner button) on a related list. The button is visible on the related list, but the issue is that the button appears in the default list view of the table also.
I tried to restrict the UI Action visibility by using the condition "g_form.getTitle() == relatedListName" in the condition field. However, the UI Action is displayed even when the condition evaluates to false. Though i have made the UI Action as client side, I see "g_form.getTitle()" is not working in the condition field.
It would be much helpful if someone can suggest me a way to restrict the UI Action to be visible only on related list.
Thanks,
Udhay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-10-2015 05:29 AM
Hi,
I tried using RP.isRelatedList() function in the condition field and it solved my issue. Now my UI action button is visible only on related list.
Thank you Tanaji and Pradeep
Regards,
Udhay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2018 03:54 AM
For future reference and clarification, for a UI action that was only intended for, in my case, the versions of scripts when already looking at a versionable record, this did not work:
RP.isOneToMany() || RP.isManyToMany()
This did:
RP.isRelatedList()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-10-2015 05:35 AM
Tanaji's solution will work perfect. To be more specific you can use
For Many-to-Many related list use RP.isManyToMany() in condition.
For One-to-Many use RP.isOneToMany() in condition.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
I'm digging up bones due to a lack of satisfactory answers.
What doesn't work:
g_list, GlideList2: Conditions are server-side and cannot access g_list.
RP.anything: I had some trouble reverse-engineering this, but it seems like RP is usually undefined or null on a regular form.
"parent" object appears to be availabel in the condition field as a GlideRecord object of the record on the form. It will be undefined in a list view. You can use typeof(parent) === "object", or access the properties of "parent" to get more specific. parent.getRecordClassName() === "table_name" should show it only as a related list to a specific table.
"tables" also appears to be an array that, if on a related list, contains the parent table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
I should add that I tested more and found that RP does have callable functions, but none of them are useful for this purpose. RP.isRelatedList() didn't seem to do anything (and is undocumented) and is*ToMany doesn't have useful logic for this use-case.
