Hi all,
I want to open an URL from an entity form with JavaScript. In this form i have two attributes "mrd_telefon" and "mrd_name", the values have to be send to a nother entity wich i want to open in a new window with the given values from the two attributes. The target attributes are "phonenumber" and "to".
Here is my code:
var RnNum = Math.floor(100000000 + Math.random() * 900000000);
var serverUrl = "mrd-custom.api.crm4.dynamics.com/main.aspx;extraqs=";
var extRaqs = "&phonenumber=" + Xrm.Page.getAttribute("mrd_telefon").getValue();
extRaqs += "&to=" + Xrm.Page.getAttribute("mrd_name").getValue();
var url = serverUrl + encodeURIComponent(extRaqs) + "&histKey=" + RnNum.toString() + "&newWindow=true&pagetype=entityrecord";
function openNewPhoneCall(){
debugger;
window.open(url);
}
The function is on Load. I get no administrable error message just a simple error.
The result is the following URL: mrd-custom.api.crm4.dynamics.com/main.aspx;extraqs=%26phonenumber%3D0843164991278%26to%3Dtest_neu&histKey=334057691&newWindow=true&pagetype=entityrecord#847925429
Pleas tell me where is my mistake.
Thank you very much guys!