First create a HTML code.
senario:
giving colours in form:
HTML code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Test Page </title>
<script type="text/javascript">
var Xrm;
if (window.opener) { Xrm = window.opener.Xrm; }
else if (window.parent) { Xrm = window.parent.Xrm; }
onload = function () {
var myOptionSet = Xrm.Page.data.entity.attributes.get("new_flag");
// var optionSetValue = myOptionSet.getValue();
var optionSetText = myOptionSet.getText();
document.bgColor = optionSetText;
//alert(optionSetValue + " " + optionSetText);
}
</script>
</head>
<body>
</body>
</html>
Create Web resource:
paste the code in Source place:
just add like web resource in the form
u will get like:
another example:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>trying</title>
<script id = "demo" type="text/javascript">
var Xrm;
if (window.opener) {
Xrm = window.opener.Xrm;
}
else if (window.parent) {
Xrm = window.parent.Xrm;
}
onload = function () {
debugger;
var myname = Xrm.Page.data.entity.attributes.get("new_name").getValue();
var mytest = Xrm.Page.data.entity.attributes.get("new_test").getValue();
document.write(myname);
document.write(mytest);
}
</script>
</head>
<body>
</body>
</html>
onload = function () {
debugger;
var myname = Xrm.Page.data.entity.attributes.get("new_name").getValue();
var mytest = Xrm.Page.data.entity.attributes.get("new_test").getValue();
var table = "<table border='1'><tr><td> Name </td> <td> Test </td> </tr><tr><td>" + myname + "</td><td>" + mytest + "</td></tr></table>";
document.write(table);
//document.write(mytest);
}
senario:
giving colours in form:
HTML code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Test Page </title>
<script type="text/javascript">
var Xrm;
if (window.opener) { Xrm = window.opener.Xrm; }
else if (window.parent) { Xrm = window.parent.Xrm; }
onload = function () {
var myOptionSet = Xrm.Page.data.entity.attributes.get("new_flag");
// var optionSetValue = myOptionSet.getValue();
var optionSetText = myOptionSet.getText();
document.bgColor = optionSetText;
//alert(optionSetValue + " " + optionSetText);
}
</script>
</head>
<body>
</body>
</html>
Create Web resource:
paste the code in Source place:
just add like web resource in the form
u will get like:
another example:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>trying</title>
<script id = "demo" type="text/javascript">
var Xrm;
if (window.opener) {
Xrm = window.opener.Xrm;
}
else if (window.parent) {
Xrm = window.parent.Xrm;
}
onload = function () {
debugger;
var myname = Xrm.Page.data.entity.attributes.get("new_name").getValue();
var mytest = Xrm.Page.data.entity.attributes.get("new_test").getValue();
document.write(myname);
document.write(mytest);
}
</script>
</head>
<body>
</body>
</html>
onload = function () {
debugger;
var myname = Xrm.Page.data.entity.attributes.get("new_name").getValue();
var mytest = Xrm.Page.data.entity.attributes.get("new_test").getValue();
var table = "<table border='1'><tr><td> Name </td> <td> Test </td> </tr><tr><td>" + myname + "</td><td>" + mytest + "</td></tr></table>";
document.write(table);
//document.write(mytest);
}
No comments:
Post a Comment