Friday 22 February 2019

Job to get distinct display product number in D365FO

In this blog I will discuss how to get distinct display product number in Dynamics 365 Finance and Operations. Please see below screenshot with source code explanation.

Note: In my case I have get Item Id and Invent Dim Id from RFQ Lines.

Explanation of source code (1.1):
  • Get purchase request for quotation from RFQCaseId and LineNum.
  • Updating inventory dimensions.
  • Find or Create inventory dimension.
  • Find inventory dimension combination is order to get product variant record Id.
  • Get display product number and set in info method.




Thursday 21 February 2019

How users can print reports to their default printer in Dynamics 365 for Finance and Operations

End-users often demand to print reports to their default printer in Dynamics 365 for Finance and Operations. Unfortunately, there is no such functionality in standard D365FO. If you take a look at Print destination settings, there is no option available to set up the default printer.
























In this article I will show you how to set up your default printer in D365FO and then print reports using this setup. The prerequisite is to install a free add-on for D365FO called
Docentric, which provides many improvements regarding report print destinations, including Printing to default printer.

Let’s say that you want to print a Sales invoice report (Accounts receivable -> Inquiries and reports -> Invoices -> Invoice journal) to your default printer.








In order to do so, we need to configure the Docentric default printer in Print management settings for the Sales invoice report. Go to (Accounts receivable -> Setup -> Forms -> Form setup -> General (Tab) -> Click Print management). Select the Customer invoice report, click the arrow next to the Destination field and select Printer setup:





















This will open the Print destination settings form. Click Show Docentric destinations:
























Select default printer (@DEFAULT_PRINTER@) option in Printer print destination: 
























After accepting the selection, the resulting Print management setup form will look like this: 



















After the above described set up, when I run the Sales invoice report, it is printed to my default printer as shown in the image below. (In my case I am using PDFCreator as my default printer)









Now let’s see how to enable users to set up their own default printers and achieve the above result. Open the Docentric parameters form (Organization administration -> Docentric AX -> Docentric AX parameters), select the Security tab page and in the Default printer field group set Allow users to set up default printer.












Docentric free add-on provides each user the possibility to check his or her default printer by opening the User options form > Account tab > Default printer selection fast tab. If the above explained Allow users to set up default printer setting is enabled, user can set up his or her default printer by clicking the Change my default printer link.









This will open the User’s printer settings form where only the record for the current user is displayed and the Default printer value can be modified.










Administrator account also has the rights to configure the default printers for users and user groups, from the Printer print destination fast tab in Docentric AX Parameter form. You can find these options in the below image. Once you select the default printer value, it will enable the above described functionality for the selected users or user groups. 














That is all you need to do to start using the default printer functionality provided by the Docentric Free-Edition tool.

Get global parameter value in Query Based SSRS report in D365FO & AX2012

Recently I have got a requirement in which I have to add a new parameter in query based report, since I cannot change the query ranges so there is no option left except to use Global Parameter. I have simply add the parameter but unable to get the value of it. I have also search over the internet but couldn't find the solution, so after a little struggle with D365 I have able to solve this problem by writing only one line source code that returns my global parameter value and meet my requirement.

Note: In SSRS report global parameters are added directly into to the report by right-clicking on the Parameters node and choosing Add. Microsoft dynamics adds several parameters into each report in order to pass data required every report to execute. Parameters created with query range or from contract classes are pretty straight forward but the other set of parameters, the global ones, are more difficult to understand. You can learn more about parameters from this link.

Source Code:






//Get the parameter value
boolean parameterValue = this.parmReportContract().parmRdlContract().getParameter("Parameter Name in SSRS Report").getValueTyped();

That is all you need to write to get global parameter value.

Monday 18 February 2019

Rearm Dynamics 365 Finance & Operations Virtual Machine

In this blog I will discuss how to Rearm Dynamics 365 Finance & Operations Virtual Machine for reactivating license which maintains the virtual machine. When you updated the license it will add 180 days of evaluation period. After 180 days are over, you can extend the evaluation period for the same number of days maximum three times.

Please follow step by step process:

Step: 1
Run command prompt as Administrator.

























Step: 2
Now run command Slmgr /dlv to track the remaining number of “rearm” in your virtual machine. In my case all three rearm counts are remaining.














Step: 3
Close the information box and run command Slmgr /rearm in order to rearm the windows. When you run the command system will ask for the restart of the machine.
















Step: 4
After you restart the virtual machine check again the status of the windows license it will now update the count of rearm.














That is it you need to do for Rearm Dynamics 365 Finance & Operations Virtual Machine.

How to fix Error: "Common Language Runtime detected an invalid program" in D365FO

Recently, we upgraded our environment, which resulted in one of our customizations, previously working flawlessly, throwing the "Common...