共用方式為


適用於 Dynamics 365 管道整合架構 2.0 的 createTab (JavaScript API 參考)

備註

只有在焦點工作階段屬於提供者,或是主工作階段或預設工作階段時,才使用此 API。

在焦點工作階段中建立索引標籤,並傳回已建立索引標籤的唯一識別碼。

語法

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

參數

名稱 Type Required 說明
輸入 繩子 Yes JSON 輸入
successCallback 回調 功能 建立記錄時要呼叫的函式。 已建立索引標籤的唯一識別碼 (索引標籤識別碼) 會在回應中傳回。
errorCallback 回調 功能 作業失敗時要呼叫的函式。 將傳遞具有以下屬性的物件:
errorCode:數字。 錯誤碼。
message:字串。 描述問題的錯誤訊息。

參數JSON的 input 結構如下:

{
    //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>;
}

返回值

Promise 的索引標籤 ID 值為 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);
});