Today I will be discussing about how to drill through action URL to a field in an SSRS report. Basically a drill through report is a report that a user opens by clicking a linked item in another report. It allows the users to drill through additional data.
Lets say we want to create a hyper link for invoice id field in Payment journal report in AX.
Step 1) Open visual studio and go to view menu and select application explorer.
Step 2) Expand AOT and navigate to Visual studio project -> C sharp projects -> SRSDrillThroughCommon project and edit it.
Step 3) Open DrillThroughCommonHelper class and search pre build method for vendor invoice journal form.
Step 4) Open your report from AOT. In my case its ledger journal and add data method into it. It will add business logic class to your project where you will write code for calling drill through method.
Step 5) Add a reference of SRSDrillThroughCommon project in business logic project.
Step 6) Open LedgerJournal.cs class and implement DrillInvoiceNumber method.
Step 7) Now open report in designer and right click on properties of invoice id text box. Go to action tab and select go to URL radio button and add expression in it.
Step 8) Change font color of text box to blue.
Step 9) Change access properties of SRSDrillThroughCommon and LedgerJournalReport.BusinessLogic where you need to set Deploy to client to yes.
Step 10) Build and deploy.
Step 11) Go to Account payable -> Journals -> Payment -> Payment Journals -> Select journal -> Lines -> Print -> Journals. Click on invoice id and it will navigate to invoice journal form and highlight the row of clicked invoice number.
Monday, 29 October 2018
Tuesday, 23 October 2018
Create your first MS Flow
Today, I will be discussing about the Microsoft Flow. The first question which will be buzzing in every one mind is What is MS Flow?
MS flow is basically a service which will allow you to create automated workflows between your applications and services to synchronize files, get notifications, collect data and much more. When you will sign up for MS flow, you will be able to connect with more than 220 services such as share point , Microsoft SQL Server etc.
There are many templates which have been provided that will help you to build flows in just few steps. For example you can easily build flows to send reminder or notifications of weather forecast etc.
Lets say we have a scenario in which we want to daily reminder on email. So we will choose a template of Get daily reminders in email.
Step 1) Select button to use this flow. For this first login to MS Flow then go to templates and browse send get daily reminders in email.
Step 2) Click on continue button. You flow design will be opened. Where you can set the sender email id.
Step 3) You can test your flow by clicking on Test button on right corner.
Step 4) Your flow will start running and you will receive email on the selected account.
MS flow is basically a service which will allow you to create automated workflows between your applications and services to synchronize files, get notifications, collect data and much more. When you will sign up for MS flow, you will be able to connect with more than 220 services such as share point , Microsoft SQL Server etc.
There are many templates which have been provided that will help you to build flows in just few steps. For example you can easily build flows to send reminder or notifications of weather forecast etc.
Lets say we have a scenario in which we want to daily reminder on email. So we will choose a template of Get daily reminders in email.
Step 1) Select button to use this flow. For this first login to MS Flow then go to templates and browse send get daily reminders in email.
Step 2) Click on continue button. You flow design will be opened. Where you can set the sender email id.
Step 3) You can test your flow by clicking on Test button on right corner.
Step 4) Your flow will start running and you will receive email on the selected account.
Wednesday, 17 October 2018
Vertical splitter in AX 2012
Vertical splitter is basically a separator which will be aligned vertically on form and it is used for separation of two sections on the form. User can stretch or expand the section by dragging the splitter.
Following are the steps which are required for creation of vertical splitter.
Step 1) Create a new group inside the main group. Group will be in between left and right groups.
Step 2) Right click on vertical splitter group properties and set following values on them.
Step 3) Override init method of the form and add below code in it.
Step 4) Override following methods on vertical splitter group and add below code.
Following are the steps which are required for creation of vertical splitter.
Step 1) Create a new group inside the main group. Group will be in between left and right groups.
Step 2) Right click on vertical splitter group properties and set following values on them.
Step 3) Override init method of the form and add below code in it.
Step 4) Override following methods on vertical splitter group and add below code.
Tuesday, 16 October 2018
Chain of command Or Method wrapping in D365
Microsoft has improved the functionality of class extension for D365FO by adding wrap logic around methods which are defined in the base class that you are augmenting. Apart from this now you can extend the logic of public and protected methods without using event handlers. After wrapping a method, you can access its public and protected methods and variables of that class without making them hookable or using pre or post event handlers.
Note : Features is available in Extension (PU8).
Step 1) I have created a class in model A and add a protected method in it.
Step 2) Create a new class in Model B that will be extension of DemoParentCOC class and add below code in it.
You will see here that you are now able to call protected method by using next keyword.
The calling stack will execute in such a way that it will first go to Standard method and finds out if there is any extension method. If it will find out any extension then it will call to it. In extension method again it will try to find out any other extension method. If their is not any second extension method then it will call first standard method logic. After executing logic of standard method COCTest of DemoParentCOC class, it will call remaining code of extension method.
If we did not define NEXT word method else it will not execute standard method.
Step 3) After executing the class, it output will be in this way:
- Info : "COC Started" printed
- Info : "Base class" printed
- Info " "COC ended" printed
Note : Features is available in Extension (PU8).
Step 1) I have created a class in model A and add a protected method in it.
Step 2) Create a new class in Model B that will be extension of DemoParentCOC class and add below code in it.
You will see here that you are now able to call protected method by using next keyword.
The calling stack will execute in such a way that it will first go to Standard method and finds out if there is any extension method. If it will find out any extension then it will call to it. In extension method again it will try to find out any other extension method. If their is not any second extension method then it will call first standard method logic. After executing logic of standard method COCTest of DemoParentCOC class, it will call remaining code of extension method.
If we did not define NEXT word method else it will not execute standard method.
Step 3) After executing the class, it output will be in this way:
- Info : "COC Started" printed
- Info : "Base class" printed
- Info " "COC ended" printed
Friday, 12 October 2018
Delegates in D365FO
Today, I will be discussing about how to use delegates in D365 finance and operations. Delegate method are quite helpful in solving dependencies whenever we are trying to communicate between objects that exist in different models or packages. As per new structure of D365 we won't be able to use element outside the package or to whom we don't refer. But delegate functionality is something which will allow us to access elements in higher model from lower model. For instance we have a scenario in which model-A wants to call model-B object but it does not have reference of it. So in this case we will be using delegate. Delegation declaration must contain 3 things - Delegate keyword, void return type and method should be empty.
Lets say we want to modify a method by inserting code in the middle of it. Or we have a object which requires accessibility in higher model and on basis of that field we need to start or stop a validation. For the creation of delegate and subscribing to it following steps are required.
Step 1) Create a delegate method.
Step 2) Create a Subscriber to your delegate. For this go to your delegate method and right click on it. Select copy event handler class and paste it in your event handler class. Add your logic in the subscribed method.
Step 3) Invoke the delegate method in middle of class method where it is required.
Lets say we want to modify a method by inserting code in the middle of it. Or we have a object which requires accessibility in higher model and on basis of that field we need to start or stop a validation. For the creation of delegate and subscribing to it following steps are required.
Step 1) Create a delegate method.
Step 2) Create a Subscriber to your delegate. For this go to your delegate method and right click on it. Select copy event handler class and paste it in your event handler class. Add your logic in the subscribed method.
Step 3) Invoke the delegate method in middle of class method where it is required.
Tuesday, 9 October 2018
Workflow submit manager code for client and Enterprise portal (EP) in AX 2012
Today I will be sharing the code of workflow submit manager class for the client and enterprise portal.
You all have noted that whenever a workflow type is created at that time automatically its submit manager class is generated. I have used same class and added two different methods for workflow submit manager in order to segregation for client and EP calling. Then in main method i have called those two methods on basis of menu item condition.
You may create a new class for submit manager or use existing generated and add following code in it.
Note: If you are creating new class for submit manager don't forget to select that class in properties of workflow type.
You all have noted that whenever a workflow type is created at that time automatically its submit manager class is generated. I have used same class and added two different methods for workflow submit manager in order to segregation for client and EP calling. Then in main method i have called those two methods on basis of menu item condition.
You may create a new class for submit manager or use existing generated and add following code in it.
Note: If you are creating new class for submit manager don't forget to select that class in properties of workflow type.
Add hierarchy token in WorkflowLimitHierarchyProvider for custom workflow in AX 2012
Hierarchy assignment provider is used to determine a user Id based on a search in a hierarchy. As we all know that hierarchy provider gives limited options for the starting point of the workflow hierarchy and those options are :
- Workflow originator : It is the user who is submitting the workflow.
- Workflow owner : It is the user who is configuring the workflow.
- WorkerRecId
- Personnel Number
Let's say we have scenario in which a person is making a request on behalf of any employee and we need to send that request to level 1 manager or immediate supervisor of employee for approval. In this case we won't be able to find out any starting through standard hierarchy start points. For achieving our goal we have potentially two methods :
- We can make changes in standard WorkflowLimitHierarchyProvider class. Since it is available for all workflow types and its association type is set on global level.
- Create a new hierarchy assignment provider and hierarchy provider class. This class will implement workflowHierarchyProvider interface and we will attach it will our custom hierarchy assignment provider.
Note : Right now I am following first approach but it is not recommended because we might face issue in future upgrade.
Following are the steps required to make those changes.
Step 1) Go to AOT ->Workflow node -> Providers -> Hierarchy Assignment -> WorkflowLimitHierarchyProvider. Right click on it and check its properties. Here you will find out the provider class in which you need to do customization for your custom workflow.
Step 2) Create a new custom EDT which will extend HcmWorkerRecId.
Step 3) Assign this newly created EDT to your employee id field on custom table.
Step 4) Go to AOT -> Classes -> WorkflowLimitHierarchyProvider
Here you need to make changes in following methods.
- GetSupportedDataType : In this method we will add code our newly created EDT.
- convertToNodeDataType : Here on basis of newly created EDT we will be able to get our worker/ employee recid who request is to be submitted to its manager. After getting the worker recid we will find out its personnel number.
Note: I am not using standard EDT of HcmWorkerRecId directly because it will be used by many tables.
Step 5) Go to your workflow configuration-> Approval -> Step -> Assignment -> Hierarchy Selection. Now verify your custom start point and drop down will be showing worker token. I have added expression of employee level 1. So the workflow will be submitted to employee immediate manager or super visor for approval.
You may verify your employee immediate super visor by following this navigation : Human Resources -> Worker position assignment -> Click on position -> New form will opened of position -> View in hierarchy . Here IT Head immediate supervisor is Mohsin Akram.
Also check hierarchy relationship and record should add for the assignment of reports to position (Mohsin Akram).
Saturday, 6 October 2018
Move elements from one layer to another in AX 2012
Today, I will be discussing about how to move customization or elements from one layer to another.
Let's say we have a scenario in which we want to move element from usr layer to var.
Following steps are required for moving elements to another.
Step 1) Go to AOT and select the element you want to export. For this purpose right click on it and select export option. Save your exported element on desired path.
Step 2) Use the AOT and delete the element from the layer you don't want further more.
Note : When you delete a table, all data in the table and ID references will be lost.
Step 3) Close Dynamics AX client.
Step 4) Open the Dynamics AX on the layer where you want to move elements. For setting layer use this link : Set the layer .
Step 5) Import the elements from xpo on your desired layer where you want to move.
Let's say we have a scenario in which we want to move element from usr layer to var.
Following steps are required for moving elements to another.
Step 1) Go to AOT and select the element you want to export. For this purpose right click on it and select export option. Save your exported element on desired path.
Step 2) Use the AOT and delete the element from the layer you don't want further more.
Note : When you delete a table, all data in the table and ID references will be lost.
Step 3) Close Dynamics AX client.
Step 4) Open the Dynamics AX on the layer where you want to move elements. For setting layer use this link : Set the layer .
Step 5) Import the elements from xpo on your desired layer where you want to move.
Create custom workflow participant assignment provider type in AX 2012
In Dynamics AX, workflow provider is used to provider specific information to workflow instance on runtime. Let's say we have a scenario in which an employee want to make a request for anything as per requirements and its requires approval from its department manager/head. In this case workflow provider type participant assignment will be created.
Participant assignment provider type : It is used for resolving a logical role into one or more users ids. For example. this provider is used to resolve a Microsoft Dynamics AX security role into the users assigned to that role.
Following steps are required for creating custom workflow participant assignment provider type.
Step 1) Create a new class and it will implement workflow participant provider interface.
Step 2) Add a new method and enter following code for the getParticipantTokens method of interface. It will be used for defining user groups. In my case its department Manager. Tokens add method accepts first parameter of participant workflow token id and second participant workflow token name.
Participant assignment provider type : It is used for resolving a logical role into one or more users ids. For example. this provider is used to resolve a Microsoft Dynamics AX security role into the users assigned to that role.
Following steps are required for creating custom workflow participant assignment provider type.
Step 1) Create a new class and it will implement workflow participant provider interface.
Step 2) Add a new method and enter following code for the getParticipantTokens method of interface. It will be used for defining user groups. In my case its department Manager. Tokens add method accepts first parameter of participant workflow token id and second participant workflow token name.
Step 3) Add another method and enter following code for the resolve method. This method will be used for adding users to user list . For demo purpose i have added Admin user to user list and it will be returned on runtime and will be send to this user for approval purpose. You may add users as per your requirements.
Step 4) Add below code for construct method.
Step 5) Create new custom participant assignment provider. For this purpose go to AOT and expand its workflow node. Now go to providers node then participant assignment node. Now right click on it and add new participant assignment provider.
Step 6) Set following properties on it.
- Name : The name of the custom provider
- Label : The label of the custom provider
- HelpText : A description for the custom provider
- Association type : Specify whether workflow provider is used at company or global level.
- AvailableForAllWorkflowTypes : Specify whether workflow provider will be used for all workflow types.
- ProviderClass : Workflow provider class which will be used for specifying the behavior of custom provider. We have created that class provider earlier .
Step 7) Expand newly created workflow provider node and right click on workflow type and add new workflow type. Set your required workflow type on its properties.
Step 8) You may verify your provider on workflow configuration. Go to workflow designer and go on its step part. Check assignment properties and you will see newly created of type of participant and it will have participant as Department Manager. Remember that Department Manager was add as token in getParticipantTokens method of class.
Subscribe to:
Posts (Atom)
Custom Business events Part 3 - (Activate custom business event) in D365 F&O
In this blog we will discuss about the steps to activate a custom business in D365 F&O. As we know that business event catalog does not...
-
Today, I will share another part of connecting azure blob storage with Dynamics 365 for finance and operations series. This part will be abo...
-
Today I will be discussing about how to create batch job through x++. Before going in code lets discuss what are batch jobs. Batch job : ...
-
Today, I will share another part of connecting azure blob storage with Dynamics 365 for finance and operations series. This part will be abo...