function lockUnlockFields(executionContext,fieldName,lockunlock) { var formContext = executionContext.getFormContext(); let objEntity = formContext.data.entity; objEntity.attributes.forEach(function (attribute, i) { if (attribute.getName() == fieldName) { let attributeToDisable = attribute.controls.get(0); attributeToDisable.setDisabled(lockunlock); } }); }
function unlockMyFields(executionContext) { var formContext = executionContext.getFormContext(); var fieldNames = ['unit','discountpercentage'];//put here the logical names of the fields to unlock for(i=0;i < fieldNames.length;i++) { lockUnlockFields(executionContext,fieldNames[i],false); } }
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
MVP-Daniyal Khaleel 125
Tom_Gioielli 101 Super User 2025 Season 2
Erin Lubben 57