Importing PO Using XML Port

Sankaran_BalasubramonianSankaran_Balasubramonian Member Posts: 20
Hi All,

I am trying to import a PO using XMLPort. The PO Schema to be imported is given by our client. I am pretty much new to Navision. Please do help me out. I am here by attaching the XMLPort that I have designed. To execute the this XML Port, I wrote a code unit, which is as follows. But not sure why, the XML Port is not working or for that matter bringing in the data. Can some one throw some light ??
Documentation()
/*
  Created By    Balaji
  Created On    15th May 2009

  Revision History
  Sr No     Defect Number       Trigger Modified      Modified By       Modified On       Reason For Modification
*/

OnRun()
// Get - Set Import File Path
IF NVSetup.GET() = TRUE THEN
BEGIN
  ImpFlPth := NVSetup."Import File Path" + '\' + 'PurchaseOrderImportXMLFile.xml';
END
ELSE
BEGIN
  NVLogPrvdr.WriteLog('',Err0004);
  EXIT;
END;

// Check Whether The File Exists
IF NOT EXISTS(ImpFlPth) THEN
BEGIN
  NVLogPrvdr.WriteLog('',STRSUBSTNO(Err0001,ImpFlPth));
  EXIT;
END;

// Try To Open The Import File
IF POXMLFl.OPEN(ImpFlPth) = TRUE THEN
BEGIN
  // Create Instream For The Vendor XML File
  POXMLFl.CREATEINSTREAM(POFlStrm);
  //Import The XML File Using XMLPort
  IF XMLPORT.IMPORT(50003,POFlStrm) = TRUE THEN
  BEGIN
    // Import Is Successful. Close The XML File.
    POXMLFl.CLOSE;
  END
  ELSE
  BEGIN
    NVLogPrvdr.WriteLog('',STRSUBSTNO(Err0003,ImpFlPth,Tit0001));
  END;
END
ELSE
BEGIN
  NVLogPrvdr.WriteLog('',STRSUBSTNO(Err0002,ImpFlPth));
END;


Hi All,

Thanks for all the help. I figured out the issue. It was something to do with the XML file itself. Thanks once again, everyone.

Thanks & Best Regards
Balaji
--
Thanks & Best Regards

Sankaran Balasubramonian

Answers

  • canadian_baconcanadian_bacon Member Posts: 91
    Your lines and dimensions are indented incorrectly. For the lines, for example, they are nested under STime and should be nested under the header.
Sign In or Register to comment.