web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

i have a html web resource and below is my code which i get my fields and i want to set the data i given in the html form how can i do it

(0) ShareShare
ReportReport
Posted on by 76
<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Dupe.html</title>
<meta charset = "UTF-8" />
</head>
<body>
<div>
<form>
<legend>Dupe Contact</legend>
<label>First Name: <input type="text" id="fn"></label> <br />
<label>Last Name: <input type="text" id="ln"></label><br />
<label>Job Title: <input type="text" id="jt" ></label><br />
<label>Account Name: <input type="text" id="an"></label><br />
<label>Email: <input type="text" id="email"></label><br />
<label>Business Phone: <input type="text" id="bp"></label><br />
<label>Mobile Phone: <input type="text" id="mp"></label><br />
<label>Fax: <input type="text" id="fax"></label><br />
<label>Preffered Method Of contact: <input type="text" id="pmoc"></label><br />
<label>Street 1: <input type="text" id="s1"></label><br />
<label>Street2: <input type="text" id="s2"></label> <br />
<label>City: <input type="text" id="city"></label> <br />
<label>State: <input type="text" id="st"></label> <br />
<label>Zip Code: <input type="text" id="zc"></label> <br />
<label>Country: <input type="text" id="c"></label>
<input type="submit" value="Submit" onclick="closeWin()">
</form>
</div>
<script src="../ClientGlobalContext.js.aspx" type="text/javascript" ></script>
<script>
function getelem()
{
fn = document.getElementById("fn").value;
window.opener.Xrm.Page.getAttribute("fullname").setValue(fullname);
ln = document.getElementById("ln").value;
fullname = fn + " " + ln;
jt = document.getElementById("jt").value;
window.opener.Xrm.Page.getAttribute("jobtitle").setValue(text);
an = document.getElementById("an").value;
window.opener.Xrm.Page.getAttribute("parentcustomerid").setValue(text);
email = document.getElementById("email").value;
window.opener.Xrm.Page.getAttribute("emailaddress1").setValue(text);
bp = document.getElementById("bp").value;
window.opener.Xrm.Page.getAttribute("telephone1").setValue(text);
mp = document.getElementById("mp").value;
window.opener.Xrm.Page.getAttribute("mobilephone").setValue(text);
fax = document.getElementById("fax").value;
window.opener.Xrm.Page.getAttribute("fax").setValue(text);
pmoc = document.getElementById("pmoc").value;
window.opener.Xrm.Page.getAttribute("preferredcontactmethodcode").setValue(text);
s1 = document.getElementById("s1").value;
window.opener.Xrm.Page.getAttribute("fieldvalue").setValue(text);
s2 = document.getElementById("s2").value;
window.opener.Xrm.Page.getAttribute("fieldvalue").setValue(text);
city = document.getElementById("city").value;
window.opener.Xrm.Page.getAttribute("fieldvalue").setValue(text);
st = document.getElementById("st").value;
window.opener.Xrm.Page.getAttribute("fieldvalue").setValue(text);
zc = document.getElementById("zc").value;
window.opener.Xrm.Page.getAttribute("fieldvalue").setValue(text);
c = document.getElementById("c").value;
window.opener.Xrm.Page.getAttribute("fieldvalue").setValue(text);
}
function closeWin() {
myWindow.close();
}
</script>
</body>
</html>

*This post is locked for comments

  • amritesh Profile Picture
    362 on at

    Hi ,

    You can write Odata/ WEB API query to insert/update data into an entity. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
ScottDurow Profile Picture

ScottDurow 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans