//{código original CLEARALL(); CodPais:=''; ltBusRel.RESET; ltBusRel.SETRANGE("Contact No.",ContactoNo); ltBusRel.SETRANGE("Business Relation Code",'CLI'); IF ltBusRel.FINDFIRST THEN BEGIN Contact.RESET; Contact.SETRANGE("No.",ltBusRel."Contact No."); IF Contact.FIND('-') THEN IF Contact."Country/Region Code"<> '' THEN BEGIN CodPais:=Contact."Country/Region Code"; CodPostalEndEnv:=Contact."Post Code"; pesquisacontacto.SETTABLEVIEW(Contact); END ELSE BEGIN CodPais:='PT'; pesquisacontacto.SETTABLEVIEW(Contact); END; END; //}
{ CLEARALL(); CodPostalEndEnv:=Contact."Post Code"; ltBusRel.RESET; ltBusRel.SETRANGE("Contact No.",ContactoNo); ltBusRel.SETRANGE("Business Relation Code",'CLI'); IF ltBusRel.FINDFIRST THEN BEGIN ltcustomer.RESET; ltcustomer.SETRANGE("No.",ltBusRel."No."); IF ltcustomer.FIND('-') THEN BEGIN "Ship-to Address".RESET; "Ship-to Address".SETRANGE("Customer No.",ltBusRel."No."); IF "Ship-to Address".FIND('-') THEN BEGIN REPEAT CodPostalEndEnv:="Ship-to Address"."Post Code"; pesquisacontacto.SETTABLEVIEW("Ship-to Address"); UNTIL "Ship-to Address".NEXT=0; END ELSE BEGIN CodPostalEndEnv:=Contact."Post Code"; pesquisacontacto.SETTABLEVIEW(Contact); END; END; END ELSE BEGIN ltBusRel.RESET; ltBusRel.SETRANGE("Contact No.",ContactoNo); IF ltBusRel.FINDFIRST THEN BEGIN CodPostalEndEnv:=Contact."Post Code"; pesquisacontacto.SETTABLEVIEW(Contact); END; END;
Payment Terms - Export::OnPreXMLItem() CLEARALL(); CodPais:=''; ltBusRel.RESET; ltBusRel.SETRANGE("Contact No.",ContactoNo); ltBusRel.SETRANGE("Business Relation Code",'CLI'); IF ltBusRel.FINDFIRST THEN BEGIN Contact.RESET; Contact.SETRANGE("No.",ltBusRel."Contact No."); IF Contact.FIND('-') THEN IF Contact."Country/Region Code"<> '' THEN CodPais:=Contact."Country/Region Code" ELSE BEGIN CodPais:='PT'; pesquisacontacto.SETTABLEVIEW(Contact); END; ltcustomer.RESET; ltcustomer.SETRANGE("No.",ltBusRel."No."); IF ltcustomer.FIND('-') THEN BEGIN "Payment Terms".RESET; "Payment Terms".SETCURRENTKEY(Code); "Payment Terms".ASCENDING(FALSE); "Payment Terms".SETFILTER(Code,'%1|%2',ltcustomer."Payment Terms Code",'A'); IF "Payment Terms".FIND('-') THEN BEGIN pesquisacontacto.SETTABLEVIEW("Payment Terms"); END; END ELSE BEGIN CodPais:='PT'; "Payment Terms".RESET; "Payment Terms".SETFILTER(Code,'%1','A'); pesquisacontacto.SETTABLEVIEW("Payment Terms"); END; END;
Contact - Export::OnPreXMLItem() CLEARALL(); CodPais:=''; ltBusRel.RESET; ltBusRel.SETRANGE("Contact No.",ContactoNo); ltBusRel.SETRANGE("Business Relation Code",'CLI'); IF ltBusRel.FINDFIRST THEN BEGIN Contact.RESET; Contact.SETRANGE("No.",ltBusRel."Contact No."); IF Contact.FIND('-') THEN IF Contact."Country/Region Code"<> '' THEN CodPais:=Contact."Country/Region Code" ELSE BEGIN CodPais:='PT'; pesquisacontacto.SETTABLEVIEW(Contact); END; ltcustomer.RESET; ltcustomer.SETRANGE("No.",ltBusRel."No."); IF ltcustomer.FIND('-') THEN BEGIN "Ship-to Address"."Post Code":=ltcustomer."Post Code"; "Ship-to Address".INSERT; ShiptoAddress.RESET; ShiptoAddress.SETRANGE("Customer No.",ltcustomer."No."); ShiptoAddress.SETCURRENTKEY("Customer No.",Code); IF ShiptoAddress.FINDFIRST THEN BEGIN IF ShiptoAddress.Code<>'' THEN BEGIN REPEAT "Ship-to Address":=ShiptoAddress; "Ship-to Address".INSERT; UNTIL ShiptoAddress.NEXT=0; END; END ELSE BEGIN "Ship-to Address"."Post Code":=Contact."Post Code"; "Ship-to Address".MODIFY; END; END; END ELSE BEGIN Contact.RESET; Contact.SETRANGE("No.",ContactoNo); IF Contact.FIND('-') THEN BEGIN CodPais:='PT'; "Ship-to Address"."Post Code":=Contact."Post Code"; "Ship-to Address".INSERT; pesquisacontacto.SETTABLEVIEW(Contact); END; END;
Answers
Node Name Prefix Node Type Source Type Data Source
XMLPesquisaContacto Element Text <XMLPesquisaContacto>
ContactoNo Element Text <ContactoNo>
Contacto Element Table <Contact>(Contact)
No Element Field Contact::No.
CodPostal Element Field Contact::Post Code
CodPais Element Text <CodPais>
PaymtTerms Element Table <Payment Terms>(Payment Terms)
CodTerms Element Field Payment Terms::Code
Descricao Element Field Payment Terms::Description
Ship-toAddress Element Table <Ship-to Address>(Ship-to Address)
CodPostalEndEnv Element Text <CodPostalEndEnv>
Tip: Ship-toAddress temporary