AX 2009 - Sales order Invoice - Batch Printing Issue

Hi

I realized that i posted the following question to the wrong form (membership questions).
Could someone please help me in this regard?

Hi

Im quite new to Dynamics AX and we use AX-2009 in Virtual PC for Development.

I’m trying to do Sales order- Invoice as Batch processing. My objective is
to print the Sales Order > Invoice as Batch process in terms of EMail / File
/ Printer

I use my local Virtual PC machine as both AX Client and AOS Batch Server.

To print batch, I setup following things.

  1. I set “Server Configuration”, “Batch Groups” under Administration > Setup

  2. And as per help, I set “Connect to printers on this server” properties
    both in Dynamics AX 2009 client and server configuration utility.

Whenever the batch process runs, I got the following errors on different
scenarios.

  1. When configured the printer for Email, the InfoLog shows the below
    error

Error: Method ‘send’ in COM object of class ‘CDO.Message’ returned error code 0x80040211 () which means: .

  1. When configured the printer for File, the InfoLog shows the below error

Error: “Target file must be in UNC format.”

  1. When configured the printer to my local Printer got the error saying

Error: “Selected printer is not an AOS printer”

Am I missing something?

Could someone please assist me in this regard?

Thanks in advance

Jaff

Hi

After few attempts, I have found the solution for #2 (Send to File) and #3 Printer (partially),

  1. When I Configure my “Printer Setup”, I should give UNC path i.e, \ComputerName\Folder\FileName instead of Physical path. (but if i have more than one invoice, this file overwritten with latest Sales Order record)

How do I print one-to-one file per Sales Order ?

  1. When Configured “Printer Setup” > “Printer” to “AOS: Microsoft XPS Document Writer”, It will prompt for Save location (but when i run batch i don’t need this prompting which needs user action) . Still no luck to print directly to Printer

For the Case 1 i.e., EMAIL,I’m still getting error even though i configured through “E-Mail Parameters” form (Administration >)

Any thoughts…???

Jaff

Hi Jaff,

did you ever make any progress with your issues?

I’m having the same problems. I had a play around with administraion > email parameters until I found a combination that worked (my active directory name and password seems to work, or alternatively ticked use NTLM), so hopefully I have that setup correctly. One of my problems was I was trying to send a PDF and therefore got an error (I guess because i didnt have adobe installed on the server?). When i changed the attachment to send as a txt file, the email sent fine… now the only issue is no matter which email address it sends to (even gmail), it is like the email has been send from the account it is being sent to. Like when i send it to a gmail address and click reply, it reply’s to the same gmail address.

To run a batch job and have a report print to a printer, it looks like I need to have an AOS printer installed? I’ve logged on to the aos server and added a network printer… no luck though.

Any help would be much appreciated.

Hi Jaff,

In reference to question #1, I faced the same problem. The fact that the “printer setup” writes always the same filename, can be used as an advantage. It is not a great solution, but it Works. I used the following code after the report was printed.

fileA = path saved in printer setup with the file name. For example: c:\file.pdf
fileB = new path and name. For example: = path + custinvoicejour.invoiceId

if (winapi::fileExists(fileA))
{
winapi::copyFile(fileA,fileB);
winapi::deleteFile(fileA);
info(strfmt(“Invoice %1 created”, fileB);
}

Hope it helps