Nota
Capaian ke halaman ini memerlukan kebenaran. Anda boleh cuba mendaftar masuk atau menukar direktori.
Capaian ke halaman ini memerlukan kebenaran. Anda boleh cuba menukar direktori.
Mencipta tab aplikasi dalam sesi tertumpu dan mengembalikan pengecam unik tab.
Sintaks
Microsoft.Apm.createTab(AppTabInput);
Parameter
| Nama | Jenis | Diperlukan | Perihalan |
|---|---|---|---|
| AppTabInput | Rentetan | Ya | Sifat input JSON tab yang akan dibuat. |
Struktur parameter JSON AppTabInput adalah seperti berikut:
{
//Unique Name of the Application Tab Template
// type = string
templateName: <unique name of the application tab template>;
//additional context for tab creation and tab slugs
// type Map<string, string>
appContext?: Map<string, string>;
//should this tab be focused after creation
// type=boolean
isFocused?: <true or false>;
}
Nilai pulangan
Pengecam tab sebagai Rentetan.
Contoh
Contoh ini menggunakan createTab kaedah untuk melancarkan tab baharu.
Buat tab asas
Mencipta tab baharu dalam sesi fokus, menghantar nama entiti, recordId dan nama templat tab aplikasi sebagai parameter.
var tabInput = {templateName: "msdyn_entityrecord", appContext: new Map().set("entityName", "account").set("entityId", " 22cc22cc-dd33-ee44-ff55-66aa66aa66aa"), isFocused: true};
Microsoft.Apm.createTab(tabInput);
Cipta tab menghantar nilai kepada borang entiti
Mencipta tab baharu dalam sesi tertumpu yang menghantar nama entiti dan nama templat tab aplikasi sebagai parameter. Ia juga mengisi borang entiti sasaran dengan nilai tambahan.
var formParams = {};
formParams["subject"] = "Collaboration task";
formParams["actualdurationminutes"] = 60;
formParams["prioritycode"] = 2;
formParams["scheduledend"] = "12/12/2030 10:00"
formParams["regardingobjectid"] = "aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb";
formParams["regardingobjectidname"] = "How do I measure my tamp pressure?";
formParams["regardingobjectidtype"] = "incident";
var tabInput = {
templateName: "msdyn_entityrecord",
appContext: new Map().set("entityName", "task").set("formId", "d5b4a1b2-de4f-4f86-8768-b0730001e7d1").set("data", JSON.stringify(formParams)),
isFocused: true
};
Microsoft.Apm.createTab(tabInput);
Cipta tab dengan sumber web
Mencipta tab baharu dalam sesi tertumpu yang menghantar sumber web sebagai parameter untuk templat tab aplikasi.
var tabInput = {templateName: "msdyn_omnichannel_kbsearch", isFocused: true};
Microsoft.Apm.createTab(tabInput);
Cipta tab dengan sumber web yang menghantar parameter sumber web
Mencipta tab baharu dalam sesi tertumpu yang menghantar templat tab dan parameter sumber web sebagai parameter templat tab aplikasi.
var tabInput = {
templateName:"msdyn_omnichannel_kbsearch",
appContext: new Map().set("data", "Contoso"),
isFocused: true};
Microsoft.Apm.createTab(tabInput);
Cipta tab dengan sumber web yang menghantar nama sumber web dan parameter sumber web
Mencipta tab baharu dalam sesi tertumpu yang menghantar templat tab, nama sumber web dan parameter sumber web sebagai parameter templat tab apl.
var tabInput = {
templateName:" new_tabtemplate_customwebresource",
appContext: new Map().set("data", " Contoso ").set("webresourceName","msdyn_kbsearchpagehost.html"),
isFocused: true};
Microsoft.Apm.createTab(tabInput);
Cipta tab dengan halaman kawalan rangka kerja komponen Power Apps
Mencipta tab baharu dalam sesi tertumpu yang menghantar kawalan rangka kerja sebagai parameter untuk templat tab aplikasi. Kawalan dihantar daripada panggilan API.
var controlDataParams = {};
controlDataParams["<parameter>"] = "<Value>";
x = new Map();
x.set("<custom_session_context_params_key>", "<Value>");
x.set("parametersStr", '[["controlName", "<Control_Name>"], ["data",'+JSON.stringify(controlDataParams)+']]');
Microsoft.Apm.createSession(
{
templateName: "<template_name>",
sessionContext: x
});
Anda juga boleh lulus parameter berikut:
var controlDataParams = {};
controlDataParams["<parameter>"] = "<Value>";
x = new Map();
x.set("<custom_session_context_params_key>", JSON.stringify(controlDataParams));
x.set("<additional_custom_session_params>", "<Value>");
Microsoft.Apm.createSession(
{
templateName: "<template_name>",
sessionContext: x
});