gpt4 book ai didi

javascript - 无法在 Crm 中使用 Javascript 关闭对话框窗口

转载 作者:行者123 更新时间:2023-11-28 05:40:05 27 4
gpt4 key购买 nike

我无法关闭在 Microsoft Dynamics crm 2016 中使用 javascript 功能区按钮的单击事件打开的对话框窗口(单击取消按钮时)。我是 Crm 的初学者。我将不胜感激任何形式的帮助。预先感谢您。

这是打开对话框的代码:

    function NewDialog() 
{
var DialogOptions = new Xrm.DialogOptions();
DialogOptions.width = 500;
DialogOptions.height = 500;
debugger;
window.parent.Xrm.Internal.openDialog(Mscrm.CrmUri.create("/WebResources/new_popupDialog").toString(), DialogOptions, null, null, CallbackFunction);
function CallbackFunction(oReturn) {

}
}

这里是对话框窗口的 Web 资源 HTML 代码:

<html><head>
<title></title>
<script src="../ClientGlobalContext.js.aspx" type="text/javascript"></script>
<script>
</script>
<style type="text/css">
body {
direction: LTR;
margin: 0px;
border: 0px;
cursor: default;
font-family: Segoe UI,Tahoma,Arial;
font-size: 11px;
}

.ms-crm-RefreshDialog-Header {
top: 0px;
position: absolute;
width: 96%;
height: 75px;
padding-top: 10px;
background-color: #FFFFFF;
border-bottom-color: #A4ABB2;
}

DIV.ms-crm-RefreshDialog-Header-Title {
font-weight: Lighter;
font-size: 27px;
font-family: Segoe UI Light, Segoe UI, Tahoma, Arial;
margin-left: 30px;
margin-right: 30px;
color: #262626;
}

.ms-crm-TextAutoEllipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

.ms-crm-RefreshDialog-Header-Desc {
padding-top: 4px;
font-family: Segoe UI,Tahoma,Arial;
margin-left: 30px;
margin-right: 30px;
color: #666666;
font-size: 12px;
}

.ms-crm-RefreshDialog-Main {
font-size: 12px;
top: 90px;
position: absolute;
bottom: 49px;
vertical-align: top;
width: 95%;
font-family: Segoe UI,Tahoma,Arial;
color: #444444;
background-color: #FFFFFF;
border-bottom-color: #A4ABB2;
right: 30px;
left: 30px;
}

.ms-crm-RefreshDialog-Footer {
position: absolute;
bottom: 0px;
width: 100%;
min-width: 288px;
height: 44px;
text-align: right;
background-color: #F8F8F8;
border-top-color: #FFFFFF;
}

.ms-crm-RefreshDialog-Button {
color: #444444;
background-color: #FFFFFF;
height: 24px;
font-family: Segoe UI,Tahoma,Arial;
border: 1px solid #C6C6C6;
background-image: none;
margin-top: 10px;
width: auto;
min-width: 80px;
white-space: nowrap;
font-size: 12px;
line-height: 16px;
width: 84px;
text-align: center;
cursor: pointer;
background-repeat: repeat-x;
padding-left: 5px;
padding-right: 5px;
}
</style>
<meta charset="utf-8"></head>
<body>
<div class="ms-crm-RefreshDialog-Main-Container" style="font-family: undefined;">
<div class="ms-crm-RefreshDialog-Header" id="tdDialogHeader">
<div title="Your dialog header" class="ms-crm-RefreshDialog-Header-Title ms-crm-TextAutoEllipsis" id="dialogHeaderTitle" style="width: 75%;">My Custom Page</div>
<div title="Your dialog additional description" class="ms-crm-RefreshDialog-Header-Desc" id="dialogHeaderDesc">Rohit</div>
<div class="ms-crm-RefreshDialog-Main" id="DlgHdBodyContainer">
<form action="demo_form.asp">
First name:&nbsp;&nbsp; <select id="selectmenu"><option selected="selected" value=""> Select an option </option> <option value="option1">Option One</option> <option value="option2">Option Two</option> <option value="option1N">Option N</option> </select><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</form>
</div>
</div>
<div class="ms-crm-RefreshDialog-Footer" id="tdDialogFooter">
<button tabindex="1" class="ms-crm-RefreshDialog-Button" id="btnOK" style="margin-left: 8px;" onclick="window.parent.Mscrm.Utilities.setReturnValue(true); window.parent.closeWindow();" type="button">
OK
</button>
<button tabindex="1" class="ms-crm-RefreshDialog-Button" id="cmdDialogCancel" style="margin-right: 30px; margin-left: 8px;" onclick="window.parent.closeWindow();" type="button">
Cancel
</button>
</div>
</div>


</body></html>

这是对话框的屏幕截图:

enter image description here

最佳答案

我知道问题出在哪里了。谢谢。替换

src="../ClientGlobalContext.js.aspx"

src="ClientGlobalContext.js.aspx"

关于javascript - 无法在 Crm 中使用 Javascript 关闭对话框窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38995802/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com