Saturday, November 3, 2007

Client:Unexpected target(1)

I have never seen this error message from AX before this week when a client of us started getting it quite frequently.

At the client site they got this error in one of the sales form letter reports. But only when there was a note in the document management and only when they used printer, printer archive og e-mail as output.

We tried to change almost every propery on the report, in particlar those related with the output from DocuRef, but nothing helped.

Well after some hours of this we finally found the bug. Another team member had implemented a change from the standard to how the documents notes were printed. In the process he had moved the line to print these in the fetch method. But he moved it to a place before the place where the print job settings are loaded from the sales form letter setup.

So lessons learned: Don't try to print anything in a report if you intend to change the print job settings later.