Pages

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.

5 comments:

Mr. Denize said...

You just saved me a couple of hours of research - would probably never have discovered this if it hadn't been for this post. Excellent and thanks a million

/Steffen

Charlie Firpo said...

Well...I dont understand too much..
I have the same problem, but I dont know how to solve it..
Could you explain me what does the error means and how to solve it ?
Thank you.

Palle Agermark said...

Check that your report hasn't sent anything to be printed, at the point where you try to change something about the printer settings.

Changing anything about the printer settings must be finished before doing any actual printing.

Peter said...

Thanks a lot for this post. I was debugging on it for almost a day before it finally turns out to be caused by an unwanted change in printJobSettings during printing of the project invoice.

So indeed the fetch method in relation to the print settings was also the case in my X++-puzzle.

Regards

Peter

Peter said...

Thanks a lot for this post. I was debugging on it for almost a day before it finally turns out to be caused by an unwanted change in printJobSettings during printing of the project invoice.

So indeed the fetch method in relation to the print settings was also the case in my X++-puzzle.

Regards

Peter