Controlling the display items of the UI action "Show Schedule"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2024 01:33 AM
I want to control the visible items on the visible calendar screen with the following UI actions:
Where can I adjust this?
Is it a UI page? A widget?
I want to reduce the number of items displayed on the screen when I click on a registered schedule displayed on the calendar screen.
I want to reduce the number of items displayed on the registration screen when I click on an available schedule on the calendar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2024 04:33 AM
Hello @bonsai ,
You need to determine if the calendar is part of a UI Page, a Widget (if you are using the Service Portal), or another component.
1. If the calendar is part of a UI Page, Modify the script to control the number of items displayed. This could involve adjusting the parameters used in the calendar rendering logic.
2. If the calendar is part of a Service Portal Widget, Search for the Widget that corresponds to your calendar. Open the Widget and go to the Client Script or Server Script section where the calendar data is fetched and rendered. Modify the script to limit the number of items displayed on the calendar. This might involve filtering the data before it is passed to the client.
3. If you need to control the behavior through UI Actions, Search for the UI Action with the sys_id provided (in your case). Adjust the script to control the data fetched or modify the client script to limit the number of items displayed.
4. If you want to adjust the number of items displayed on the registration screen when clicking on a schedule, Find the form or modal used for registration. Go to System UI > Forms and search for the form used. Adjust the fields and related lists to control the number of items displayed.
Example script for widget:
Client script:
function($scope, $http) {
// Fetch calendar events
$http.get('/api/now/table/calendar_events').then(function(response) {
var allEvents = response.data.result;
// Limit to 10 events
$scope.events = allEvents.slice(0, 10);
});
}
Server script:
(function() {
var eventGR = new GlideRecord('calendar_events');
eventGR.query();
var events = [];
var count = 0;
while (eventGR.next() && count < 10) {
events.push(eventGR.getDisplayValue());
count++;
}
data.events = events;
})();
Thank you!!
Dnyaneshwaree Satpute
Tera Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2024 11:49 PM
I ended up not understanding what this UI action was calling...
Which record should I modify?