Hi there everyone,
Does anyone know how can I disable the opportunity products Grid on opportunity after a value of a field is set to something.
can I do it with business rules or a plug-in has to be written.
*This post is locked for comments
Hi there everyone,
Does anyone know how can I disable the opportunity products Grid on opportunity after a value of a field is set to something.
can I do it with business rules or a plug-in has to be written.
*This post is locked for comments
JavaScript is not recommended,
Workflow didn't work for me,
So can anyone tell me how can I make it read-only after the value of a field is set to XXX.
or ,
how can I remove the '+' from the grid so that no records are added, and also be able to make the list of records in the grid not editable?
Rather doing it with a plugin?!
Regards
This may help.
Hi,
You could write the following javascript code to achieve this functionality.
function DisableSubgridsOnFieldValueSet() { //Get the field value var value = Xrm.Page.getAttribute("fieldName").getValue(); //Get the subgrid control var subGrid = Xrm.Page.ui.controls.get("SubGridName"); // If subgrid is not loaded yet, then call same function after some time. if (subGrid == null) { setTimeout(DisableSubgridsOnFieldValueSet, 1000); return; } if (value != null) { debugger; subGrid.setDisabled(true); } }
Hope this helps.
The easiest way to achieve this is to create a real time workflow checking opp. product opportunity lookup value.
When the opportunity.xxx field = xxx, cancel the workflow, then the error will be shown to the users (to prevent user creating any opp. product and associate to the opportunity)
JS is not the full proof option as user might still be create opp. product via quick view, advanced find or any other options.
HI A.Sam,
Write the javascript, on the particular field value set you can disable the Tab/Section.
Regards,
Krishna Shahapur
Dynamics 365 Developer
The only way to enforce this would be a plugin on the opportunityproduct entity, which would check the field and throw an exception if a user tries to create or update an opportunityproduct.
The only other option I can think of would be to convert the opportunity to a quote, and change the quote status, but that might interfere with other processes
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156