The Infolog

A blog of Dynamics AX development tips and tricks

Skip to: Content | Sidebar | Footer

Tag: X++

Adding fields to PurchPurchaseOrder (Purchase order confirmation)

25 March, 2015 (14:25) | Dynamics AX, SSRS | By: Howard Webb

Hi, Sometimes we need to add fields to a report that uses transactional data. Normally these have their own transactional tables such as CustInvoiceJour, however this report is different. If you check the method \Classes\PurchPurchaseOrderDP\createData you can see that the DP class uses PurchLineAllVersions and PurchTableAllVersions to get its data for the report. We will […]

Running a SSRS report via code

10 March, 2015 (11:22) | Dynamics AX, SSRS | By: Howard Webb

Sometimes we would like to run an SSRS report via code to produce a report without user interaction or to call it during a process. To do this we could call the menu item that launches the report, but more often than not we would like to prepopulate it or call it without user interaction. […]

Getting the report name for a AX2009 report

8 September, 2014 (15:02) | Dynamics AX | By: Howard Webb

  I was on site with a 2009 customer the other day who were starting to develop their own reports. Being quite a few years since I have done it I had forgotten this trick to get the report name that is being run. If you modify the method \Classes\SysReportRun\run and include this line:   […]

Reprinting invoices using printJournal

29 August, 2014 (14:12) | Dynamics AX, SSRS | By: Howard Webb

If you need to reprint a sales invoice there is a method on the CustInvoiceJour table called printJournal. Calling this method will print using the original print management destination but you can override the destination by passing in an instance of SalesInvoiceJournalPrint. Below is an example of calling it and forcing the print destination to […]

Counting the number of records in a query/query run

17 August, 2014 (15:53) | Dynamics AX | By: Howard Webb

Hi,   This post is more for my memory more than anything else. If you need to get the number of records returned in a query or a query run you can use the following method: SysQuery::countLoops(QueryRun)   This will return the same result as looping through the query using queryRun.next()

Printing external customer statements to multiple file names

10 June, 2014 (11:02) | Dynamics AX, SSRS | By: Howard Webb

One of our customers produce multiple PDF files for external customer statements. They wished to rename the file with the customer account number. To do this we have edited the following method:   \Classes\CustAccountStatementExtController\runPrintMgmt   I declared the following variables   To make sure that I get just the file name correctly I have used […]

Using date effective tables in a view

7 May, 2014 (14:13) | Dynamics AX | By: Howard Webb

When writing a select statement or using a query you do not have to worry about if the table is a date effective table or not, the frame work handles this for you and will as default return the record that is current. If you are using a view however you need to do a […]

Display/Edit method caching

4 March, 2014 (10:54) | Dynamics AX | By: Howard Webb

When developing a new form or a new table that will have display or edit methods we should be thinking about how costly these types of methods are. Adding lots of these methods to a form can cause a large delay in opening and refreshing as these methods are recalculated every time a refresh is […]

Google maps mini-map for customers

10 October, 2013 (14:04) | Dynamics AX, Uncategorized | By: Howard Webb

I wanted to move some of the google maps work I did in AX 2009. One of the bits I did originally was to produce a mini map in the customer screen:   I decided to fit better with 2012 I have moved it to a factbox. To create a fact box first you have […]

Saving and merging Infolog items for later use

29 September, 2013 (15:38) | Uncategorized | By: Howard Webb

The job below that will get Infolog items, clear them and save each one for later use. This can be of use when you need to record the Infolog for later viewing static void Job1(Args _args) { container errors; container t; int i; int length; ;   warning(“Test1”); error(“Test2”); errors = conIns(errors, 1, t);   […]