API Docs for: 2.0.20133.2
Show:

ui.caseManagement.createCase.ui.caseManagement.createCase Class

Item Index

Methods

Methods

render

(
  • config
)
Promise static

Render the case management case creation UI.

Parameters:

  • config CreateCaseConfig

    A CreateCaseConfig object that contains options for rendering the create case user interface

    • [uiInfo] ui.UIInfo optional

      A ui.UIInfo object

      • [type] ui.HostType optional
        A value in {{#crossLink "ui.HostType"}}{{/crossLink}} which indicates the type of UI to render e.g. IFRAME, POPUP.
      • [containerSelector] String optional
        Only required for iframe -- a JQuery selector statement to define the element into which the iframe will be loaded
      • [height] Number optional
        The height of the rendered UI
      • [width] Number optional
        The width of the rendered UI

Returns:

Promise:

A promise that resolves to when the component has successfully loaded the user interface

Example:

// Render caseManagement as a iframe.
// More UIInfo examples available here
var uiInfo = {
    type: MsSupportSdk.ui.HostType.IFRAME,
    containerSelector: Iframe container selector
};

// Pass user information through encrypted auth token.
// user information can be encrypted through Secury Context Pass (previously named Delegated Auth)
// user information includes [{ name: 'cid', value: '0123459' }, { name: 'authType', value: AAD }, { name: 'jarvisId', value: '02132123'}, { name: 'firstName', value: 'Tom' }, { name: "lastName", value: "Hanks" },
// { name: "displayName", value: "Tom Hanks" }, { name: "email", value: "tomhanks@sample.com" }, { name: "countryCode", value: "us" }, { name: "timeZoneId", value: "Pacific Standard Time" }]
// cid: Unique customer id from authentication. for MSA it's PUID in Hexadecimal.
// javrvisId: Unique userId from Jarvis service by converting from MSA PUID or AAD TID/OID
// countryCode: The country the customer is receiving support in. The expected format is the country 2-letter ISO name (see RegionInfo class)
// timeZoneId: The time zone is used to specify actual time zone of contact on the case. The expected format complies with TimeZoneId (see TimeZoneInfo class)
var authInfo = {
    type: MsSupportSdk.ui.AuthType.DELEGATED,
    token: encrypted user authentication information. 
};

// Create a ui.caseManagement.Config
var config = {
    uiInfo: uiInfo,
    authInfo: authInfo,
    locale: "en-us", // All parameters down to here are required
    sapId: "7bc2893c-807e-14f2-8fa4-29e57ad3549e", // Optional. Default is empty. used to identify which product and support category this issue is for
    entitlementId: "012345678", // Optional. Default is empty. used for idenfitying which entitlement is used to create case
    preview: false, // Optional. Default is false. Used for preview unpublished compass data
    envrionment: MsSupportSdk.ui.virtualAgent.Environment.PRODUCTION, // Optional environment, use DEV for testing
    includedWorkflowSteps: [internal.ui.caseManagement.WorkflowStep.FORM]
    onCaseSubmitted: function(data) {
        if (data.caseId) {
             console.log("Case created: " + data.caseId);
        }
        else {
             console.log("Case creation failed. Error message: " + data.errorMessage);
       }
    }
    onSubmittingCase: function() {
         // client handling on submitting case
    }
    onWorkflowLoaded: function() {
         // client handling on workflow loaded
    }
 };

// Render CaseManagement UI
MsSupportSdk.ui.caseManagement.render(config).then(
    function() {
        console.log("Case management rendered successfully.");
    },
    function(err) {
        console.log(err.message);
    });