Options

How to export singular PO information as XML

compwizardcompwizard Member Posts: 17
edited 2011-06-14 in NAV Three Tier
Very simple request which is baffling me ..

All I want to do is when a PO is posted (and Receive is selected as the posting option) I wish to record the data within the posted PO as an XML file.

IF EXISTS('C:\temp\XML_CUSTOMER.XML') THEN
ERASE('C:\temp\XML_CUSTOMER.XML');

POFile.CREATE('C:\temp\XML_CUSTOMER.XML'); //Creates file
POFile.CREATEOUTSTREAM(POStream); //Creates stream
XMLPORT.EXPORT(8000,POStream);
POFile.CLOSE;

Works well, but I obviously end up with everything.

I know I need to use SETRANGE and probably record the appropriate Document Number, but just can't get my head round it! HELP! ](*,)

Comments

  • Options
    ReinhardReinhard Member Posts: 249
    It's similar to running a report for a specifc record.

    Option 1
    Use the third, optional, parameter for the record set.
    XMLPORT.EXPORT(Number, OutStream [, Record])

    Example
    PO.SETRECFILTER;
    XMLPORT.EXPORT(8000,POStream,PO);
    

    Option 2
    Declare XML Port as a variable "POExport"
    PO.SETRECFILTER;
    POExport.SETTABLEVIEW(PO);
    POExport.SetDestination(POStream);
    POExport.RUN;
    
  • Options
    compwizardcompwizard Member Posts: 17
    That's great :D Thanks for the help.
Sign In or Register to comment.