I need to pass values from contact form to a custom activity but not very sure how best to do this
below is what i have but its not working.
In the contact form on load event i have created the following function
function loadActivity() {
var parameters = {};
var contactid = Xrm.Page.data.entity.getId();
parameters["contactid_0"] = contactid;
Xrm.Utility.openEntityForm("new_testActivityForm", null, parameters);
}
Then in the custom activity form(new_testActivityForm), I want to populate the fields, Regarding Contact, DOB, FullName
I have created a parameter called contactid_0 on the custom activity form(new_testActivityForm) then created the following in the new_testActivityForm form load event
function getQuerystring(key, default_) {
if (default_ == null) default_ = "";
key = key.replace(/[[]/, "\[").replace(/[]]/, "\]");
var regex = new RegExp("[\?&]" + key + "=([^&#]*)");
var qs = regex.exec(window.location.href);
if (qs == null)
return default_;
else
return qs[1];
}
function populateActivity() {
if (getQuerystring('contactid_0') != "") {
var contactid = getQuerystring('contactid_0');
contactid = contactid.substr(3, 32);
}
}
how do i make this to work, return the values and populate the activity form with Regarding Contact, DOB, FullName
*This post is locked for comments
I have the same question (0)