cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Bhuvita
Level: Powered On

Launch custom control from ribbon button

Is it possible to launch the custom control grid from ribbon button like playbook.

 

Attach is the screenshot for the same.

1 ACCEPTED SOLUTION

Accepted Solutions
ben-thompson
Level 8

Re: Launch custom control from ribbon button

You can create a button that calls Javascript and use the NavigateTo function to open the entities list page.

 

That list will open using the default list control for the entitity so if you change the default control to your custom control of the entity that should work..

 

Going forward (April) you may be able to use Xrm.Navigation.navigateTo to open a particular form type for the current record see https://powerusers.microsoft.com/t5/Power-Apps-Component-Framework/PCF-Open-main-form-in-a-dialog-us... that would allow you to say navigate to another "form" for the current entity on which you just showed your PCF control in the appropriate context..

View solution in original post

7 REPLIES 7
ben-thompson
Level 8

Re: Launch custom control from ribbon button

You can create a button that calls Javascript and use the NavigateTo function to open the entities list page.

 

That list will open using the default list control for the entitity so if you change the default control to your custom control of the entity that should work..

 

Going forward (April) you may be able to use Xrm.Navigation.navigateTo to open a particular form type for the current record see https://powerusers.microsoft.com/t5/Power-Apps-Component-Framework/PCF-Open-main-form-in-a-dialog-us... that would allow you to say navigate to another "form" for the current entity on which you just showed your PCF control in the appropriate context..

View solution in original post

Bhuvita
Level: Powered On

Re: Launch custom control from ribbon button

Thanks I will give this a shot
Bhuvita
Level: Powered On

Re: Launch custom control from ribbon button

@ben-thompson 

But entity list can't be open in modal dialog 

ben-thompson
Level 8

Re: Launch custom control from ribbon button

My mistake - the second approach will work from April though - you can create a single purpose form and open it up in a modal window which contains just the data grid you want.

@carldesouza  did I nice demo and post about it yesterday see https://carldesouza.com/using-the-new-modal-dialog-to-open-forms-in-dynamics-365-using-xrm-navigatio...

Re: Launch custom control from ribbon button

It looks like you actually need a Lookup Dialog. I suppose the Xrm.Utility.lookupObjects() is not an option for you, but that would have been the easiest way to select a record and then start another logic.

I'm not very sure if using Xrm.Navigation.navigateTo() would add some unwanted elements (tabs, form header if it's a form with a subgrid) and I'm not sure if you can have the "Launch" button on the bottom.

If the page should look like in the screenshot, another alternative would be to make your own HTMLWebresource and open it using Xrm.Navigation.navigateTo().

Not very sure about your use case, but I suppose that you need to create a record using a template. Maybe there is another approach possible: to open the record in create mode, and have a field for the template on it. Right now is not possible to have the Lookup as a PCF control, but you could customize a dummy string-field which you can customize as a PCF component. When the  value is empty, you can make use of the PCF context.mode.setFullScreen(true) feature to directly open the grid in fullscreen. You would have to write your own grid, but have then full control on what's on the header/footer of your dialog. 

I don't see a perfect solution though...

 

Bhuvita
Level: Powered On

Re: Launch custom control from ribbon button

So my use case is like this I want to have button on the ribbon of opportunity form and on click of that button wants open the view of another custom entity and also have launch button exact like screenshot and associate the opportunity record with the record selected in the view.

 

I tried to do this so wrote JavaScript on the ribbon button to open the another main form of the opportunity using Xrm.navigation.navigateto()

 

Then applied the custom control on subgrid but here I can't remove the BPF applied command bar etc.

ben-thompson
Level 8

Re: Launch custom control from ribbon button

Stealing from https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/233876/removing-hiding-business-pr...

 

use the following code to hide the bpf when the form loads by adding it to the pageload of the form you are using in the modal window

 

function PageLoad() {
       Xrm.Page.ui.process.setVisible(false); //Hide Business Process Flow
}

 

 

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Users online (10,049)