Pass executionContext from ribbon Archives - Microsoft Dynamics 365 Blog https://microsoftdynamics.in/tag/pass-executioncontext-from-ribbon/ Microsoft Dynamics CRM . Microsoft Power Platform Sat, 22 Aug 2020 10:32:24 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.5 https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/04/cropped-Microsoftdynamics365-blogs.png?fit=32%2C32&ssl=1 Pass executionContext from ribbon Archives - Microsoft Dynamics 365 Blog https://microsoftdynamics.in/tag/pass-executioncontext-from-ribbon/ 32 32 176351444 Pass executionContext or formContext from Ribbon WorkBench button in UCI Unified client interface https://microsoftdynamics.in/2020/08/22/pass-execution-context-or-form-context-from-ribbon-workbench-in-uci-unified-client-interface/ Sat, 22 Aug 2020 10:32:24 +0000 http://microsoftdynamics.in/?p=4071 With Depreciation of xrm.page which was used to get attribute/property of an item of form. We all have switched to the latest FormContext which require executionContext need top be passed as a Parameter "Pass Execution Context as First Parameter" from event

Now how to pass ExecutionContext for the javascript action used for a Button on Ribbon Workbench

1 Open Ribbon WorkBench
2 Select Solution contains entity and components
3 Add button, Add command
4 Now add Javascript Action and select Javascript and Function
5 Now Click on Add Parameter

The post Pass executionContext or formContext from Ribbon WorkBench button in UCI Unified client interface appeared first on Microsoft Dynamics 365 Blog.

]]>

With Depreciation of xrm.page which was used to get attribute/property of an item of form. We all have switched to the latest FormContext which require executionContext need top be passed as a Parameter "Pass Execution Context as First Parameter" from event

Now how to pass ExecutionContext for the javascript action used for a Button on Ribbon Workbench

From Event Handler Property we can simply enable checkbox  “Pass execution context as first parameter ” and use that for Form Context as Below

And we can get FormContext from 1st parameter Execution Parameter.

function readXML(executionContext) {   
 if (executionContext !== null) {

             formContext =  executionContext.getFormContext();
   }
alert("executionContext  is null ");
}

How to Pass ExecutionContext or FormContext for a JS action on the button in Ribbon Workbench

  1. Open Ribbon WorkBench
  2. Select Solution contains entity and components
  3. Add button, Add command
  4. Now add Javascript Action and select Javascript and Function
  5. Now Click on Add Parameter
  6. Add CRM Parameter

  7. and select Primary  Control

1 thing to remember, like for Form Button , always use PrimaryControl as Form Control

function readXML(executionContext) {   
 if (executionContext !== null) {

             formContext =  executionContext;  //PrimaryControl
   }
alert("executionContext  is null ");
}

The post Pass executionContext or formContext from Ribbon WorkBench button in UCI Unified client interface appeared first on Microsoft Dynamics 365 Blog.

]]>
4071