Notifications
Announcements
No record found.
Hello , I have requirement to remove options from optionset on click of a record through JS . Example I have a column "Status" whose values are A , B ,C , D .On select of a record I would like to show only A & B in the editable grid.
Hi,
Please try Remove option code to remove option from your field
docs.microsoft.com/.../removeoption
Thanks for your reply .I have tried this , its not working in case of Editable Subgrid .
The gridContext is different with the formContext. If you are trying to access some control/attribute in grid, you should use gridContext rather than formContext.
Accoding to my research, this is not a doable requirement.
There are fewer methods/events you can access in grid control, compare with formContext control. You can see detail with GridAttribute.
Also here is my test result:
"executionContext" is the gridContext. "new_source" is an optionset field but it does not have the removeOption() method.
function onRowSelected(executionContext){ debugger; executionContext.getFormContext().data.entity.attributes.forEach(attribute => { if(attribute.getName() == 'new_source'){ attribute.controls.get(0).removeOption(100000001); } }); }
Also you can read more about Grid.
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 Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Tom_Gioielli 73 Super User 2025 Season 2
Daniyal Khaleel 42 Most Valuable Professional
Scott Jackson UK 22