Archive for June, 2008

Jun 03 2008

How to save XML triggered by an event

Published by rollo under Uncategorized

If you are using Business Notifications for Dynamics NAV and would like to see how does the xmlport output look like after an event is triggered, this is a post for you…
In this example “Inventory Status” event is taken into consideration, but you can use it for any other event. In order to be able to save an xml content generated by an xmlport, replace a piece of code related to “Inventory Status” event in codeunit 8000 Business Notification Mgt. with the following:
 
        REPORT::”Inventory Status”: BEGIN
          RecRef.SETTABLE(Item);
          Item.SETRECFILTER;
          ItemXML.SETTABLEVIEW(Item);
          tempBLOB.Blob.CREATEOUTSTREAM(outStream);

         ItemXML.SETDESTINATION(outStream);
          ItemXML.EXPORT;

          F.CREATE(’c:\output.xml’);
          F.CREATEOUTSTREAM(tempOutS);
          tempBLOB.CALCFIELDS(tempBLOB.Blob);
          tempBLOB.Blob.CREATEINSTREAM(tempIns);
          COPYSTREAM(tempOutS, tempIns);
          F.CLOSE();
          ItemXML.”Inventory Status”;
          LineSent := TRUE;
        END;
and just trigger an event the usual way.

/rollo

No responses yet

Jun 03 2008

Hello world!

Published by rollo under Uncategorized

This Blog is related to Business Notifications for Dynamics NAV.

Welcome!

No responses yet