Re: Passing variables to XMLPorts

I used the following statements, but the country was not passed properly. How should I correct them?

“Export Inventory Stock”.SetCountry(Country);

XMLPORT.EXPORT(XMLPORT::“Export Inventory Stock”,OutStream_lOsm);

Here are the statements used inside the XMLPORT.


SetCountry(pCountry)

Country := pCountry;


Items - “Export::OnAfterGetRecord”()

IF Country=‘CANADA’ THEN

Price := SalesPriceCalc.FindWebItemPrice(‘CAN’,Item.“No.”)

ELSE

Price := SalesPriceCalc.FindWebItemPrice(‘WEB’,Item.“No.”);

Hi Caudalie,

Well you call is wrong.

You use:

“Export Inventory Stock”.SetCountry(Country);

XMLPORT.EXPORT(XMLPORT::“Export Inventory Stock”,OutStream_lOsm);

This way NAV sees your XMLPort as two different variables. Instead do it like this:

MyPort.SetCountry(Country);
MyPort.SETDESTINATION(OutStream_lOsm);
MyPort.EXPORT := TRUE;