description
속성에 JavaScript onChange() 이벤트를 첨부 할 수 있습니다. 이벤트는 설명 값을 가져온 다음 HTML 컨트롤에서 요소를 가져온 다음 요소의 값을 description
속성 값과 같게 설정합니다. 여기
는 보일 수 있습니다 방법의 예 :
function descriptionOnChange() {
// Get the value of the description attribute.
var description = Xrm.Page.getAttribute('description').getValue();
// Get the HTML iFrame object.
var iFrame = Xrm.Page.ui.controls.get('IFRAME_WebResourceName').getObject();
// Get the element from the iFrame.
var element = iFrame.contentWindow.document.getElementById('htmlDescription');
// Set the element's value.
element.value = description;
}
참고 : 스크립트가있는 iFrame의 속성에서 비활성화되지 않은 프레임 간 확인하십시오
![cross-frame scripting enabled](https://i.stack.imgur.com/TK5MD.png)
당신을 도메인 간 iFrame 요청이 차단 된 경우 오류가 발생할 수 있습니다. 설명 및 해결 방법은 this post을 참조하십시오.
다음과 같을 수 CRM에서 해결의 구현 :
<script>
window.addEventListener('message', function(event) {
if (~event.origin.indexOf('https://<yourCRMUrl>')) {
document.getElementById('htmlDescription').value = event.data;
} else {
return;
}
})
</script>
변경하여 description
의 내용 :
가에 <script>
태그를 추가 메시지를 받아 처리하여 HTML의 <body>
속성의 onChange() 이벤트를 다음으로 변경합니다.
var description = Xrm.Page.getAttribute("description").getValue();
var iFrame = Xrm.Page.ui.controls.get('IFRAME_WebResourceName').getObject();
iFrame.contentWindow.postMessage(description, '*');
코드는 당신이 자신의 웹 리소스로 이동할 수 있습니다 성장함에 따라,
<html>
<head>
<script src="ClientGlobalContext.js.aspx" type="text/javascript"></script>
<script type="text/javascript">
function onLoad() {
var description = parent.Xrm.Page.getAttribute("description").getValue();
document.getElementById("description").innerHTML = description;
}
</script>
</head>
<body onload="onLoad()">
<table>
<thead><tr><th>Parameter</th><th>Value</th></tr></thead>
<tbody>
<tr><td>description</td><td id="description">null</td></tr>
</tbody>
</table>
</body>
</html>
또한, 그것은이 같은 HTML 헤드에 포함 :
당신은
문제를 풀려고하면 질문을 확장해야합니다 (예 : 시도한 하나 이상의 솔루션을 설명하지만 당신을 위해 일하지 않고 * 왜 * 그들이 당신을 위해 작동하지 않는지 지정하십시오.) 그렇지 않으면 질문은 귀하의 부분에 대한 연구 부족으로 인해 downvoted되고 무시됩니다. 또한 CRM 버전 (2016 의미 8.0 또는 8.1?) – Alex