Last active
August 30, 2023 20:36
-
-
Save MitchMilam/38d9fb0f91118186f96e to your computer and use it in GitHub Desktop.
Set the Section Label based on a field value
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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