How can I get the Form Widget to display a specific view WITHOUT passing in a URL parameter?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2022 05:12 AM - edited ‎12-20-2022 01:15 PM
I am trying to use the Form Widget from our service portal. The Form widget is not the first page users can get to. We have created a Simple List widget on our portal that users can see. From the Simple List, you can easily define the view to be used when clicking on a record in the list shown. That part is not an issue.
However, the 'View All' link at the bottom of the list that shows when the number of items is larger than the maximum allowed to show in the list is a different story. Clicking on that brings up a List page we have defined. We can set the fields that show on that list widget. However, clicking on one of those links then brings up the Form Widget, and that does NOT have a field to specify the view.
Since the links are opened from a generated list of records, I do not see any way to append view=<viewName> to the URL.
In looking at the code for the Form Widget, in the Server Script, it implies there are two other ways to get the view defined. One is on line 24:
data.view = input.view;
This implies there is a way to get the view in via an 'input'. The other is found in lines 38-41 of the Server Script:
if (!data.sys_id && options.sys_id_required != "true")
data.sys_id = "-1";
data.view = options.view || $sp.getParameter("view") || $sp.getParameter("v"); // no default
}
which (I think) says that you can get the view from the URL OR from 'options'.
I have confirmed that if I change the URL AFTER I open the page, it correctly will show the view I want, but I can't do that since the links are generated by the widget. Which leaves the 'input' or the 'options'.
So, where do I enter that information so it gets passed into the Form Widget?
- Labels:
-
Service Portal