I want to make my personal view as default view using javascript not through UI.
I want to make my personal view as default view using javascript not through UI.
Good day Rohit,
Thanks for your explanation.
I found on the Internet and I didn't find any information about setting default view by JS code, as you konw, there is no way for us to add js code to homepage to do some operations. I only found that we could set default view by editing solution xml files.
Hope it helps.
Best Regards,
Leo
Hi Leo,
Let me precise my query.
As we know we can set any of our personal view as default from Advanced Find screen under SAVED VIEWS by clicking Set As Default View button as shown in below image:
Lets assume I have View Id. I want achieve this using JavaScript code.
I just want to know what entity or attributes are changed on click of Set As Default View button so that I can also achieve this using JavaScript .
Regards,
Rohit Singla
Hi Rohit,
Sorry that there is no way to do this. As you know, we could only add js to form but we could not add js to homepage :-(.
So we could only use OOB way to do this with UI.
Best Regards,
Leo
Hi Leo,
Thanks for the reply :)
This would not fulfill my requirement.
The code you have written will work on form but I have to set default view for the Entity Home page grid i.e whenever user enters to the entity the view which is shown to the user.
I need to change the view on entity home page grid.
Hi partner,
1.You should get your view id with Advance Find.
2.You could use this code to set your view as default view.
function setDefaultViewSample(executionContext) { var formContext = executionContext.getFormContext(); formContext.getControl("primarycontactid").setDefaultView("{00000000-0000-0000-00AA-000010001003}"); }
Hope it helps.
Best Regards,
Leo
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