Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

Set text box value on html onload

$
0
0

Hi all


I am using this code

<!doctype html>
<html>
<head>

<script>

function retrieveAccount() {

debugger;
var currentleadId = window.parent.opener.Xrm.Page.data.entity.getId();
var select = "aw_PaymentMethod";
alert(currentleadId);
SDK.REST.retrieveRecord(
currentleadId,
"Opportunity",
select,
null,
function (opportunity) {
var addresslookup = opportunity.aw_PaymentMethod;
console.log(addresslookup);
console.log(addresslookup.Id);
console.log(addresslookup.LogicalName);
console.log(addresslookup.Name);
document.getElementById("search-text-input").value = addresslookup.Name;
alert("Test");
debugger;
},
function (error) {
alert(error.message);
}
);

}
</script>
</head>
<body onload="retrieveAccount()">

<input type='text' id='search-text-input' onload="retrieveAccount" />
<div id='button-holder'>
<img src='C:\DDrive\CRM Clients\360training.com\QS\AXPCRM-15\magnifying-glass-3-xl.png' onclick="fnOpen()" />
</div>
</body>
</html>

to fill my text box value on onload of html. but it do nothing. It shows me this alert(currentleadId);

but did not shows me this alert("Test");


Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>