Background Script Scenario based interview questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2024 05:44 AM
1.Write down the script to find out the Count of Active incidents & group them by category.
// Create a new GlideAggregate object for the 'incident' table
var count = new GlideAggregate('incident');
// Add an active query to include only active records
count.addActiveQuery();
// Add an aggregate function to count the number of records
count.addAggregate('COUNT');
// Group the results by the 'category' field
count.groupBy('category');
//Execute the query
count.query();
// Print the total number of rows returned by the query
gs.print(count.getRowCount());
// Loop through each grouped result
while (count.next()) {
// Print the category and the count of incidents in that category
gs.info(count.getDisplayValue('category') + ' - ' + count.getAggregate('COUNT'));
}
2.how to get count of total incidents in system logged
- 6,159 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-30-2024 07:16 PM
can you share more interview question based on Scripting!!
I face one interview question in interview like.
How to get form server to client in Backgorung script ???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2025 07:28 AM
you cannot directly call server to client in background script we can achieve this scenario by using glide ajax and script include