Where does my .exe run?

ccbryan63ccbryan63 Member Posts: 115
edited 2010-07-30 in NAV Three Tier
Hi all,

I have 2009 RTC installed with the top two tiers on one server.

I have written an ancillary application that is called from NAV with wshExec.Run() It creates and saves a PDF document and emails it. It is run from a NAV codeunit like so:
        IF  CompanyInfo."Enable PDF Email" = TRUE THEN
          BEGIN
            DocFile := 'R:\Executable\InvoicePrinter.exe';
            DocNumber :=  FORMAT(SalesInvHeader."No.");
            DocType := 'SI';
            DocComp := '"'+CONVERTSTR(COMPANYNAME,'.','_')+'"';
            IF FILE.EXISTS(DocFile) THEN
              BEGIN
                IF Email = TRUE THEN
                  DocEmail := 'YES';
                IF Email = FALSE THEN
                  DocEmail := 'NO';
 
                IF ISCLEAR(wShExec) THEN
                 CREATE(wShExec,FALSE,ISSERVICETIER);

                WshMode := 0;
                WaitForEndOfCommand := FALSE;

                ReturnCode := wShExec.Run(DocFile + ' ' + DocNumber + ' ' + DocType + ' ' +
                 DocEmail + ' ' + DocComp,WshMode,WaitForEndOfCommand);
             End;
         End;

Invoiceprinter.exe creates the pdf, then looks up the customer's email addres and sends the PDF in an Outlook email.

* I know this is possible within NAV2009 but I have reasons for wanting to keep running my application for now.*

This works quite well in the classic client from the workstation. It works quite well in the RTC when the client is run on the server. But when I run the RTC from the workstation my .exe does not seem to run at all. R: is mapped on the server and the workstation to the same folder (which is on the server). It seems to me that the problem has to lie with the middle tier of the RTC. Since the middle tier resides on the server, wouldn't it run 'on the server' and execute commands the same way as if the client were running on the server? Can anyone think of another direction to look in?

Thanks...

Chandler

Comments

  • bbrownbbrown Member Posts: 3,268
    But the NAV service is not aware of the drive mapping. It only knows about the local disk. Have you tried runnig the executable via a UNC path?
    There are no bugs - only undocumented features.
  • ccbryan63ccbryan63 Member Posts: 115
    Thanks! I'll give that a try.
Sign In or Register to comment.