In Client Scripts, how to check where the form is being run (Platform/ UI Builder)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 11:26 PM
I have a table form that is running in both Platform and UI builder (using slots).
There are a few g_form DOM Manipulation methods that do not work in UI builder. E.g.: getControl, getDisplayBox, getElement, etc.
1. How do I check whether the form is running in Platform or UI builder, so that I can prevent running above methods in UI builder.
Side question:
2. Can I use any other DOM manipulation methods in UI builder?
- Labels:
-
UI Framework Next Experience

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 11:41 PM
Hi,
In client script look for UI Type field. "Mobile/Service Portal" will work for Service Portal as well as UI Builder. If your script works only on Default view then you can set this to "Desktop".
Regarding your side question, I don't think DOM Manipulation is supported in this view.
Thank you,
Palani
Palani

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 11:42 PM
Hi Himanshu
if (window == null) {
// ServicePortal script
} else {
// UI Script
}