共用方式為


updateContext (應用程式設定檔管理員)

可讓您設定自動化字典,並讓提供者新增、修改和移除 slugs 的值;然後,更新的值可用於在未來呼叫巨集。

語法

Microsoft.Apm.getFocusedSession().updateContext(input);

參數

名稱 類型 為必填項目 Description
輸入 JSON Yes 要更新之工作階段內容的 JSON 輸入屬性。

返回值

沒有。

Example

Microsoft.Apm.getFocusedSession().updateContext({"customerName":"Contoso"});
Microsoft.Apm.getFocusedSession().getContext().then((context)=> context.get("customerName")).then(
    function success(result) {
        console.log(result);
        // should expected "Contoso"
        // Perform operations upon record retrieval and opening
    },
    function (error) {
        console.log(error.message);
        // Handle error conditions
    }
);