1

I have been able to pass the formContext to the javascript function that I call from the ribbon when I call it from a Form button, but the same trick when calling from the HomePageGrid pass me a null value.

I use in both cases the Primary Control CRM parameter as stated in multiple places.

enter image description here

You can see on the left side how my PrimaryControl CRM parameter is passing a null value when selecting an item on the Grid. On the right side you can see how my PrimaryControl CRM parameter is passing the formContext correctly.

is it there any way to pass the executionContext/formContext/Context?. As you can see I have tried that is the Primary Control value is null to pick up Xrm.page.context and xrm.ui.getglobalContext.... and still doesn't work.

Any idea of what to do?

This is the configuration in the Ribbon Workbench enter image description here

Updated for minohimself:

I have set the SelectedControl in the Ribbon and I am receiving on the first parameter the Mscrm.GridControl. And I dont see the formContext as you see it.

I might be doing something wrong, because it is obvious that you are able to see the context? can you point me in the right direction?

What I can see from your javascript code is that you have a theia.button which has a function called ExecuteActionWithErrorMessage that receives at least 4 parameters, including objectid, formContext, entityName, and actionName).

In my case my function is called and should receive the formContext and a yes/no (T/F) statement to decide how to manage the security roles.

So, should I include your four parameters, so I can retrieve as well the objectid, formcontext, entityname and actionname?

Thanks for your quick turn around and help.

UPDATE for minohimself

UPDATE 2:

Here you can see my Ribbon Workbench Command this is my Ribbon Workbench Command

and here you can see my Debugger View: This is my Debugger View

as you can see what you see it is not what I see. I am on a Ms. Dynamics CRM v9.0.15.9 (version 1612) on-premises.

1 Answers1

1

Have you tried SelectedControl parameter ? that one is ment for subgrids. The one youre using is used on Forms. ;)

enter image description here

I just tested what you get when you pass SelectedControl

enter image description here

enter image description here

minohimself
  • 496
  • 3
  • 9