Pass value from codeunit to XMLPort

RikarddoRikarddo Member Posts: 80
Hi,

I have a Code Unit where using webservice i receive some parameters and i turn back some values.
Simulador(ContactNo : Code[20];ItemNo : Code[20];VAR CustName : Text[50];VAR PmtTermsCode : Code[20];VAR ItemDesc : Text[50];VAR Vas : Integer;VAR Vasi : XMLport Vasilhames) : Text
 
ltBusRel.RESET;
 ltBusRel.SETRANGE("Contact No.",ContactNo);
 ltBusRel.SETRANGE("Business Relation Code",'CLI');
 IF ltBusRel.FINDFIRST THEN
 BEGIN
  ltCustomer.GET(ltBusRel."No.");
  ltPaymentTerms.GET(ltCustomer."Payment Terms Code");
 END; 
 ltitem.RESET;
 ltitem.SETRANGE("No.",ItemNo);
 IF ltitem.FINDFIRST THEN
 BEGIN
  Descricao:=ltitem."Extended Description";
  ItemContainer.RESET;
  ItemContainer.SETRANGE("Item No.",ItemNo);
  IF ItemContainer.FINDSET THEN 
  BEGIN REPEAT
     Vasilhame:=ItemContainer.COUNT;
  UNTIL ItemContainer.NEXT=0;
  END;
     
 END;
Vas:=Vasilhame;

This function counts the number of item cointainer of a product and all the item containers.
What i want is how to filter for one item?

In XMLPort or in the Codeunit and how?

This is my xml
Node Name	Prefix	Node Type	Source Type	Data Source
XMLComentariosCompra		Element	Text	<XMLComentariosCompra>
Vasilhame		Element	Table	<Item Container>(Item Container)
No		Element	Field	Item Container::Container No.

Can someone help me please? Thanks

Answers

  • RikarddoRikarddo Member Posts: 80
    Please some help?

    I have codeunit published as webservice. In that codeunit i call other codeunit that calculates some value.

    Simulador(ItemNo : Code[20];ItemContainerNo : Code[20];VAR xml : XMLport PricingToolSimulador;VAR Temp : Decimal)
    ....
    Temp:=PricingTool.GetCustoOperacao(ItemNo,Variante);

    ItemNo and Variante are parameters. Fine so far.

    My final goal is:

    I have an xmlport not based in any table. I have a variable CostOp that will export the the same value as show above

    CustoOp:=format(PricingTool.GetCustoOperacao(ItemNo,Variante));

    My dificulty here is how to pass to xmlport the Itemno and variante in the webservice codeunit??

    If i make like this CustoOp:=format(PricingTool.GetCustoOperacao('0000001010','j70-1010')); it will return a tag with
    the correct value.


    Will apreciate some tips thanks
Sign In or Register to comment.