Thursday, October 13, 2016

AX2012 EP Submit Workflow

Requirement : To enable the submit to workflow button on an EP page.
Assumption : The table is already workflow enabled in the network client.

Step 1: We will first create a web action menu called AFZEPInventTransWorkflowSubmit and specify the submit class object against it (assumption is that this is already created while the client workflow objects were created). In this case the submit handler class is called AFZInvMovementJourSubmitManager


next, create WebActionMenuItems for each of the different workflow outcomes and actions like approve, reject, delegate, cancel etc. these would be used later in Step 3. The object property for these WebActionMenuItems must be set to EPWorkflowWorkItemActionManager as shown below. 



Select the workflow template that has to be published on the portal. In this case we are exploring a template called AFZInventLossProfitJournal. Specify the SubmitToWorkflowWebMenuItem property with a Web action menu item created above.



Step 2: Update the Form on which the Submit link would be displayed. select the Workflow Approvals object under the approvals node in AOT as shown below. Generally the approval object would be with the same name as the WorkflowType.

Select the approval object and update the DocumentWebMenuItem with a WebUrlMenuItem used to display the form on which you expect the submit bar to show up.

Also update the WebMenuItems for ResubmitWebMenuItem and DelegateWebMenuItem (Highlighted below)


Step 3: Next open each of the Workflow outcomes and attach the corresponding ActionWebMenuItem to it as shown below.

 
Step 4: At this stage we are done with the workflow level changes. The next is to attach the workflow control on the user control. The workflowActionBar is attached to a Datasource and DataSourceView. These properties can also be used using the property sheet once the markup is pasted in the control body. It is important to mention the name of the workflow type being displayed.

 


Wednesday, October 12, 2016

AX2012 EP Toolbar

Requirement: To add a toolbar for add and delete line on a grid.

Step 1: Create a toolbar with the desired actions. This step would internally have two steps in first we will create a WebMenu object
The next step would be to create a WebActionMenuItem for each action that you want to appear in the menu created above. Each WebActionMenuItem being created should be associated with a Class, and this class should have a main method which would be invoked when the menu item is clicked in the portal.

Once the WebActionMenuItems are created these are dragged and drop inside the WebMenu. In our example two WebActionMenuItems are created namely AFZEPInvenTransDelete and EPInventTransAdd with labels of Add line and Remove line respectively



We are now ready to render the toolbar on the user control. To add a toolbar, the toolbar control should dragged and dropped onto the grid control. Once the toolbar control has been created it has to be associated with the Menu created in the step above, this is done using the property sheet of the toolbar.