Hi All,
I am using this sample code to get value from MS CRM Contact Record and Set value in text box of a HTML Page. But this code is not working, I want to set the values On Load of the HTML page.
<html>
<head>
</head>
<body onload="retrieveAccount()" style="word-wrap: break-word;">
<script src="ClientGlobalContext.js.aspx" type="text/javascript" ></script>
<script type="text/javascript"></script>
<script>
function retrieveContact() {
var fullname = window.parent.Xrm.Page.getAttribute("fullname").getValue();
var jobtitle = window.parent.Xrm.Page.getAttribute("jobtitle").getValue();
document.getElementById("name").value = fullname;
document.getElementById("role").value = jobtitle;
}
</script>
<form>
<p>
<label>Fullname</label>
<input type="text" id="name" onload="retrieveContact()">
</p>
<p>
<label>Jobtitle</label>
<input type="text" id="role" onload="retrieveContact()">
</p>
</form>
</body>
</html>