Dynamics 365 控制右側欄的介面

溜溜球_小钢wan發表於2024-04-26

1、效果展示:想在右邊欄切入我們自定義的html

2、可以的form的onload事件,獲取按鈕事件呼叫:

var Blog = Blog || {};
(function () {
    this.onLoad = function () {
        var navigate = function (pane) {
            pane.navigate({
                pageType: "webresource",
                webresourceName: "/new_/page/chat.html",
                data: Xrm.Page.data.entity.getId().replace("{", "").replace("}", "")
            });
        };
        var paneId = "ChatView";
        Xrm.App.sidePanes.createPane({
            title: "Chat View",
            paneId: paneId,
            canClose: false,
            width: 500
        }).then((pane) => navigate(pane));
    };
}).apply(Blog);
Blog.onLoad()

3、控制顯示隱藏:

隱藏:Xrm.App.sidePanes.state=0
顯示:Xrm.App.sidePanes.state=1

4、相關資料:

官方資料:https://learn.microsoft.com/zh-cn/power-apps/developer/model-driven-apps/clientapi/reference/xrm-app-sidepanes

其他資料:https://temmyraharjo.wordpress.com/2023/01/28/model-driven-apps-how-to-use-the-side-pane-to-show-custom-html/

相關文章