Hi,
I'm doing this test with Rest and Soap Web Services in CRM online 2013 based in a Video, but in my test I'm getting the error: "ContactoChange is undefined" when I'm changing the Contact. Any thoughts? Thank you in advance!
Danitza.
ContactoChange = function()
{
var new_name=Xrm.Page.getAttribute("new_name").getValue();
if (new_name==null) new_name"";
var contactid=Xrm.Page.getAttribute("new_Contact").getValue();
if (contactid==null) return;
// Rest
XrmServiceToolkit.Rest.Retrieve(
contactid[0].id,
"ContactSet",
null, null,
function (result) {
var emailaddress1 = result.EMailAddress1 ;
alert(emailaddress1);
},
function (error) {
equal(true, false, error.message);
},
false
);
//soap
var cols = ["emailaddress1"];
var retrievedContact = XrmServiceToolkit.Soap.Retrieve("contact", contactid[0].id,cols);
Xrm.Page.getAttribute("new_name").setValue(new_name+ retrievedContact.attributes["emailaddress1"].value);
}
*This post is locked for comments
I have the same question (0)