In my lookup control field, I am trying to map an extra field to my current SharePoint list. The extra field (“Fund”) and the field I am trying to map to (‘ApproximateRT_x0020_’) are both text fields. I’ve tried the code below but it is not updating the ‘ApproximateRT_x0020_’ SharePoint field.
fd.spRendered(function() {
// Capture change events on the CtrlLookup field
fd.control('CtrlLookup').$on('change', function(value) {
if (value) {
// Capture the value of the 'Fund' extra field
var fundValue = value.Fund;
// Set the captured 'Fund' value to the 'ApproximateRT_x0020_' field
fd.control('ApproximateRT_x0020_').value = fundValue;
}
});
//Set initial value if editing an existing item
if (fd.itemId && fd.control('CtrlLookup').value) {
var initialValue = fd.control('CtrlLookup').value.Fund;
fd.control('ApproximateRT_x0020_').value = initialValue;
}
});