Change Calendar in CSM FSM Workspace

rohanaditya
Kilo Sage

Conflict Calendar on Change

This implementation explains how to enable and configure the Conflict Calendar from a Change record within Configurable Workspace using a UI Action, Script Include, and a custom UI Builder page.


Update Conflict Calendar UI Action

  • Open the Conflict Calendar UI Action (sys_id: a8b7eac20b1332005775aabcb4673ae2)
  • Check Workspace Form Button or Workspace Form Menu
  • Verify the format is set for Configurable Workspace

Update Workspace Client Script

Update the onClick function to route the user to the custom Conflict Calendar page in Workspace.

function onClick(g_form) {
    var sys_id = g_form.getUniqueValue();
    var url = top.location.href;

    var routeGr = new GlideAjax('KAPChangeUtils');
    routeGr.addParam('sysparm_name', 'getBaseURL');
    routeGr.getXMLAnswer(function(response) {
        var route = url.split(response);
        var newUrl = route[1] + '/sub/change-conflict-calendar/' + sys_id;
        open(newUrl, '_self');
    });
}

Create Script Include

A Script Include is required to dynamically fetch the instance base URL from the server.

Script Include Configuration

  • Name: KAPChangeUtils
  • Application: Global
  • Accessible from: All application scopes
  • Client Callable: True
  • Active: True
  • Mobile Callable: False
  • Sandbox enabled: False

Script Include Code

var KAPChangeUtils = Class.create();
KAPChangeUtils.prototype = Object.extendsObject(AbstractAjaxProcessor, {
    getBaseURL: function() {
        return gs.getProperty('glide.servlet.uri').toString();
    },
    type: 'KAPChangeUtils'
});

Create Conflict Calendar Page in UI Builder

Step 1: Open UI Builder

  • Open UI Builder
  • Search for CSM / FSM Configurable Workspace
  • Click the + icon beside Pages and Variants

1.png

Step 2: Create New Page

  • Select Create a new page

2.png

  • Choose Create from scratch instead

3.png

  • Enter the name: Change Conflict Calendar

4.png

This automatically sets the URL path to change-conflict-calendar. Ensure this matches the URL used in the Workspace Client Script.

Step 3: Configure Page Parameters

  • Under Required parameters, click + Add
  • Enter parameter name as SysId
  • Provide the page name as Conflict Calendar
  • Click Continue

Step 4: Build Responsive Page

  • Select Build responsive
  • A responsive Conflict Calendar page is created
  • The page appears under Pages and Variants

Configure Page Settings

  • Open the newly created page

5.png

  • Click Settings at the top of the page

6.png

  • Under Actions, click the arrow beside Open records and select Variant record

7.png

  • Clear:
    • Macroponent configuration
    • Event mapping
  • Set App configuration to the CSM / FSM Configurable Workspace app configuration
  • Save the record

Update Page Definition

  • Open Page definition

8.png

  • A UX Macroponent Definition record opens

Using SN Utils, open the OOB record with sys_id 4b5a6af60b0d1110c85e8a8db777b270 titled Change Conflict Calendar default.

Copy the following fields from the OOB record and paste them into your new UX Macroponent Definition record:

  • Layout Model
  • Composition
  • Data
  • Internal Event Mapping
  • Properties
  • Dispatched Events
  • State

Save the record after copying all values.


Result

The Conflict Calendar button is now available on the Change form in CSM / FSM Configurable Workspace. Clicking it opens the Conflict Calendar page for the selected Change record.

9.png

0 REPLIES 0