Set Current View in Subgrid
you can set a current view using JavaScript. use below code. The object type code for the SavedQuery (1039) or UserQuery (4230) that represents the view the user can select.
function setView(executionContext) {
var ContactsIFollow = {
entityType: 1039, // SavedQuery
id: "3A282DA1-5D90-E011-95AE-00155D9CFA02",
name: "Contacts I Follow"
}
// Get the gridContext
var formContext = executionContext.getFormContext();
var gridContext = formContext.getControl("Contacts");
// Set the view using ContactsIFollow
gridContext.getViewSelector().setCurrentView(ContactsIFollow);
}
Hope this helps.