Description
Thie method return address info by addresslogickeystring addressstreet1,2,3,addresszip addresscity,addresstypecode.
Parameters
icAddressStreet1 | input | character | |
icAddressStreet2 | input | character | |
icAddressCity | input | character | |
icAddressStreet3 | input | character | |
icAddressZip | input | character | |
iiBusinessRelationID | input | integer | |
icAddressTypeCode | input | character | |
oiAddressID | output | integer | |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program3/bbusinessrelation.p)
/* Find the address record in the instance */
for first tAddress
where tAddress.addressStreet1 = icAddressStreet1
and tAddress.addressStreet2 = icAddressStreet2
and tAddress.addressStreet3 = icAddressStreet3
and tAddress.addressCity = icAddressCity
and tAddress.addressZip = icAddressZip
and tAddress.businessRelation_ID = iiBusinessRelationID
and tAddress.tcAddressTypeCode = icAddressTypeCode:
assign oiAddressID = tAddress.address_id.
end.
/* If the record does not exist in the instance then check the db*/
if not available tAddress
then do:
<Q-3 run AddressByIdByCode (all) (Read) (NoCache)
(input icAddressCity, (AddressCity)
input icAddressStreet1, (AddressStreet1)
input icAddressStreet2, (AddressStreet2)
input icAddressZip, (AddressZip)
input icAddressTypeCode, (AddressTypeCode)
input '', (AddressID)
input iiBusinessRelationID, (BusinessRelationID)
input '', (BusinessRelationCode)
input '', (AddressTypeID)
input icAddressStreet3, (AddressStreet3)
output dataset tqAddressByIdByCode) in BBusinessRelation >
/* Copy the resultset into the Address Temp-table */
/* Using the tqAddressByType temptable to populate the ad_mstr does not work */
for first tqAddressByIdByCode
where tqAddressByIdByCode.tcAddressStreet1 = icAddressStreet1
and tqAddressByIdByCode.tcAddressStreet2 = icAddressStreet2
and tqAddressByIdByCode.tcAddressStreet3 = icAddressStreet3
and tqAddressByIdByCode.tcAddressCity = icAddressCity
and tqAddressByIdByCode.tcAddressZip = icAddressZip
and tqAddressByIdByCode.tiBusinessRelation_ID = iiBusinessRelationID
and tqAddressByIdByCode.tcAddressTypeCode = icAddressTypeCode:
assign oiAddressID = tqAddressByIdByCode.tiaddress_id.
end. /* end of for each */
end.