DYNAMICS 365 HOW TO CHANGE SUBGRID SELECTED VIEW IN JAVASCRIPT

In other posts, we saw how to refresh a subgrid and how to filter a subgrid in JavaScript. In this post, we will see how to change the view selected for the subgrid in JavaScript . You can use this each time you need to display different columns in a sub grid based on a field value on the form because showing/hiding a column in a sub grid is not possible. Go to the entity form and open the form or field properties where you want to call the JavaScript function Under the Events tab, add the appropriate event handler and call the function that will change the subgrid view Save and Publish the form As outlined in the below JavaScript function, use the setCurrentView function to change the subgrid view . func...