Skip to content

Instantly share code, notes, and snippets.

@MitchMilam
Last active August 30, 2023 20:36
Show Gist options
  • Save MitchMilam/38d9fb0f91118186f96e to your computer and use it in GitHub Desktop.
Save MitchMilam/38d9fb0f91118186f96e to your computer and use it in GitHub Desktop.
Set the Section Label based on a field value
function onLoad() {
Xrm.Page.getAttribute("address1_addresstypecode").fireOnChange();
Xrm.Page.getAttribute("address2_addresstypecode").fireOnChange();
}
function addressType_onChange(executionContextObj) {
const field = executionContextObj.getEventSource();
const addressType = field.getText();
if (addressType != null && addressType !== "") {
field.controls.get(0).getParent().setLabel(addressType + " Address");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment