web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Setting the default view for button in ribbon workbench

(0) ShareShare
ReportReport
Posted on by

I have a button from ribbon workbench that allows users to add existing teams. I want the default team lookup view to be "Weekly Report Teams", but it defaults to "All Teams." How can I change it so that the initial view shown to the user is weekly report teams?

I am currently trying to do this via javascript, but it doesn't seem to be working...

function openLookup() {
    var orgUrl = GetGlobalContext().getClientUrl();
    var viewid = "%7b4F5E2C2E-7929-E811-B322-000C293DDC16%7d";
    var url = orgUrl + "/_controls/lookup/lookupinfo.aspx?LookupStyle=multi&browse=0&objecttypes=9&viewid=" + viewid;
    open(url);
}

*This post is locked for comments

I have the same question (0)
  • RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi,

    Can you share some more details how you have implemented the button? This script doens't seem to be supported.

  • Community Member Profile Picture
    on at

    There was a button in the Team subgrid that used a builtin function named something like "Mscrm.AddExistingAssociatedMember" function. I pretty much loaded my javascript web resource, along with the team and weekly report entities to ribbon workbench. In ribbon workbench, I then added a new command to the team entity which referenced my openLookup function in my javascript web resource. I then replaced the "Mscrm.AddExistingAssociatedMember" default command with my openLookup Command for the "Add Existing Team Member" button.

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi,

    As per my understanding you are going to change the team lookup view. So I would suggest just go to the page where your lookup exists  and in onload of the form you need to pass the default view I'd with your custom xml, entity name like below in the lookup control.

          Xrm.Page.getControl("LookupFieldName").addCustomView(viewId, entityName, viewDisplayName, fetchXml, layoutXml, true);

    Here is one samples I have changed the security role lookup view . You may get help from here

    community.dynamics.com/.../270206

    Hope this helps.

  • Community Member Profile Picture
    on at

    Because the button is part of ribbon workbench, I can’t access it through Xrm.Page.context

    I know how to attach custom views to lookup fields in the form, but I’m having trouble adding one for a button in ribbon workbench

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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans