I'm trying to write two sets of code:
1. Will pull and concatenate the "name" part of the array for two lookup fields
2. The second will pull and concatenate the salutation, first name, last name information from contacts in those lookup fields to build salutation
Below is the code I have so far for part one. When I run it as an OnChange event the function comes back undefined. I've never worked with a REST API.
//---AUTOPOPULATE HOUSEHOLD NAME
function = retrieveHeadofHousehold(){
SDK.REST.retrieveRecord("", "tprnew_household", "tprnew_HeadofHousehold", null, function(result) {
var tprnew_HeadofHousehold = result.tprnew_HeadofHousehold;
}, function(error) {
writeMessage("Head of Household is empty");
}
);
}
function = autopopulate_HouseholdName(){
XRM.Page.getAttribute(tprnew_HeadofHousehold).set.Value(household_name) + " and ";
}
*This post is locked for comments