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

Notifications

Announcements

No record found.

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

I have the same question (0)
  • 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans