project QadFinancials > class BBusinessRelation > method GetAddressWithID

Description

Thie method return address info by addressId.


Parameters


iiAddressIDinputinteger
tApiAddressinput-outputtemp-table
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BMfgAddress.ApiReplicateFromFinancialsEndUSer
method BMfgAddress.ApiReplicateFromFinancialsShipTo
method BMfgAddress.MaintainDataDebtorShipto
method BMfgAddress.MaintainDataEndUser
method BMfgAddressListDetail.MaintainDataDebtorEnduser
method BMfgAddressListDetail.MaintainDataDebtorShipto
method BMfgEndUser.ApiReplicateFromFinancials
method BMfgEndUser.MaintainDataBusinessRelation
method BMfgEndUser.UpdateMfgData


program code (program1/bbusinessrelation.p)

/* Find the address record in the instance */
for first tAddress
    where tAddress.address_id = iiAddressID:
    create tApiAddress.
    buffer-copy tAddress to tApiAddress.     
end.    

/* If the record does not exist in the instance then check the db*/
if not available tAddress
then do:    
    <Q-1 run AddressById (all)  (Read)  (NoCache)  (input iiAddressID, (AddressID)
                      output dataset tqAddressById) in BBusinessRelation >
       
    /* Copy the resultset into the Address Temp-table */
    /* Using the tqAddressByType temptable to populate the ad_mstr does not work */
    for first  tqAddressById 
        where tqAddressById.tiaddress_id = iiAddressID :

            assign 
              vhAddressHandle = dataset tqAddressById:get-buffer-handle(1)
              vhApiAddressHandle =  temp-table  tApiAddress:default-buffer-handle.
              vhApiAddressHandle:buffer-create.
      <M-2 run BufferCopy
           (input  vhAddressHandle (ihFrom), 
            input  vhApiAddressHandle (ihTo), 
            output viFcReturnSuper (oiReturnStatus)) in BBusinessRelation>
         if viFcReturnSuper <> 0 
         then assign oiReturnStatus = viFcReturnSuper.                   
  
    end. /* end of for each */
end.