Import xml file through Xml port

Hi All,

I’m trying to import xml file into Sales Invoice header & sales invoice Line i.e Table Sales header & Sales Line.
the xml file contains sales header & sales line, in sales line, Item No, Description & cross reference no is given.

If the Xml file does contain the Item No i.e “No.” & its having Item Cross reference No, it should go Item Cross reference No and fetch the Item No. i.e my requirement.

but the probem is that Xml file contains Item No. = 0 (integer 0) & if try to import that file, it is not reading the last line of xml file which contain Item No. =0.

here is the code written on

No - Import::OnAfterAssignField()

IF “”.“No.” =format(0) THEN BEGIN
CrossReference.SETRANGE(“Cross-Reference No.”,Cross_Reference_No);
IF CrossReference.FINDFIRST THEN
“”.“No.” :=CrossReference.“Item No.”;
end;

I’m not getting any clue how to read the sales line of xml file whihc contains Item No is equal to 0(zero), becasue Item No field type is code.

Would you please help out.

Regards
Pushpraj


Regards
Pushpraj

Hi Pushpraj,

What version of Navision are you using?

Am I understanding you correctly, that the Field “Item No.” can contain either the value “0” or the real Item No., and that if the value or that field ist “0”, then you want to go and fetch the Item No. from the Cross Reference Table?

In that case, your IF statement should look like this:

IF “Sales Invoice Line”.“No” = ‘0’ THEN BEGIN …