Hi!
I am trying to create a URL field based on a number of fields within any given company page. The main problem i am encountering is when trying to add the primary contact of a company to the string. It resolves to object Object instead of the name of the contact. Is thier anyway to pull the name of the contact that is recorded within a company? Below is my current JS
function CreateURL() {
var employeeEmail = Xrm.Page.data.entity.attributes.get("mc_nutraceuticalsowner").getValue();
var distributor = Xrm.Page.data.entity.attributes.get("mc_distributorforms").getValue();
var pharmacyName = Xrm.Page.data.entity.attributes.get("name").getValue();
var pharmacyAccountNumber = Xrm.Page.data.entity.attributes.get("mc_membershipnumber").getValue();
var state = Xrm.Page.data.entity.attributes.get("mc_stateforms").getValue();
var customerContactName = Xrm.Page.data.entity.attributes.get("primarycontactid").getValue();
Xrm.Page.data.entity.attributes.get("mc_accounturl").setValue(accountUrl);
}
The current URL being given from the script is:
*This post is locked for comments