Uredi

Deli z drugimi prek


createTab (JavaScript API Reference) for Dynamics 365 Channel Integration Framework 2.0

Note

Use this API only when the focused session belongs to the provider or if it is the home or default session.

Creates a tab in a focused session and returns the unique identifier of the created tab.

Syntax

Microsoft.CIFramework.createTab(input, correlationId).then(successCallback, errorCallback);

Parameters

Name Type Required Description
input  String Yes JSON input
successCallback Function No A function to call when a record is created. Unique identifier (tab ID) of the created tab is returned in the response.
errorCallback Function No A function to call when the operation fails. An object with the following properties will be passed:
errorCode: Number. The error code.
message: String. An error message describing the issue.

The structure of the input parameter JSON is as follows:

{
    //Unique name of the tab 
    // type = string
    templateName: <unique name of the tab template>;

    //additional context for tab creation and tab slugs
    // type = JSON Object
    templateParameters?:<>
    
    //should this tab be focused after the creation
    // type=boolean
    isFocused?: <true or false>;
}

Return value

Promise with the value of tab ID as String

Example

var tabInput = {
    //Unique Name of the Application Tab Template
    // type = string
    templateName: "msdyn_test_entity",
    templateParameters: {
    entityName: "incident",
    data: "{}",
    },
    isFocused: true
};
Microsoft.CIFramework.createTab(tabInput).then((tabId)=>{
    console.log("created tab with id" + tabId);
}, (error)=>{
    console.log(error);
});