Jun 03 2008
How to save XML triggered by an event
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