Parameters
| icRowID | input | character | |
| oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program3/bbusinessrelation.p)
/* Lookup the ID for the HEADOFFICE address */
<Q-3 run AddressTypePrim (all) (Read) (NoCache)
(input ?, (AddressTypeId)
input {&ADDRESSTYPECODESYSTEM-HEADOFFICE}, (AddressTypeCode)
output dataset tqAddressTypePrim) in BAddressType >
for first tqAddressTypePrim:
/* Get the HEADOFFICE address */
for first t_sAddress where t_sAddress.tc_ParentRowid = icRowID and
t_sAddress.AddressType_ID = tqAddressTypePrim.tiAddressType_ID:
if t_sAddress.AddressTaxIDFederal = "":U then
do:
assign vcMessage = #T-16'This field is mandatory. You must enter a value.':80(809)t-16#.
oiReturnStatus = 1.
<M-15 run SetMessage (input vcMessage (icMessage),
input '' (icArguments),
input 'Federal Tax':U (icFieldName),
input '' (icFieldValue),
input 'E':U (icType),
input 3 (iiSeverity),
input '' (icRowid),
input '-133':U (icFcMsgNumber),
input '' (icFcExplanation),
input '' (icFcIdentification),
input '' (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BBusinessRelation>
end.
if t_sAddress.AddressTaxIDFederal = "000000000":U or
t_sAddress.AddressTaxIDFederal = "999999999":U then
do:
assign vcMessage = #T-18'$1 is reserved for Federal tax. Choose another value':100(46905)t-18#.
oiReturnStatus = 1.
<M-17 run SetMessage (input vcMessage (icMessage),
input t_sAddress.AddressTaxIDFederal (icArguments),
input 'Federal Tax':U (icFieldName),
input t_sAddress.AddressTaxIDFederal (icFieldValue),
input 'E':U (icType),
input 3 (iiSeverity),
input '' (icRowid),
input 'QadFin-5112':U (icFcMsgNumber),
input '' (icFcExplanation),
input '' (icFcIdentification),
input '' (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BBusinessRelation>
end.
if t_sAddress.tcStateCode = "" then
do:
assign vcMessage = #T-10'This field is mandatory. You must enter a value.':80(809)t-10#.
oiReturnStatus = -1.
<M-9 run SetMessage (input vcMessage (icMessage),
input '' (icArguments),
input 'State':U (icFieldName),
input '' (icFieldValue),
input 'E':U (icType),
input 3 (iiSeverity),
input '' (icRowid),
input '-66':U (icFcMsgNumber),
input '' (icFcExplanation),
input '' (icFcIdentification),
input '' (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BBusinessRelation>
end.
if t_sAddress.AddressZip = "" then
do:
assign vcMessage = #T-12'This field is mandatory. You must enter a value.':80(809)t-12#.
oiReturnStatus = -1.
<M-11 run SetMessage (input vcMessage (icMessage),
input '' (icArguments),
input 'Zip Code':U (icFieldName),
input '' (icFieldValue),
input 'E':U (icType),
input 3 (iiSeverity),
input '' (icRowid),
input '-67':U (icFcMsgNumber),
input '' (icFcExplanation),
input '' (icFcIdentification),
input '' (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BBusinessRelation>
end.
if t_sAddress.AddressTelephone = "" then
do:
assign vcMessage = #T-14'This field is mandatory. You must enter a value.':80(809)t-14#.
oiReturnStatus = -1.
<M-13 run SetMessage (input vcMessage (icMessage),
input '' (icArguments),
input 'Phone Number':U (icFieldName),
input '' (icFieldValue),
input 'E':U (icType),
input 3 (iiSeverity),
input '' (icRowid),
input '-68':U (icFcMsgNumber),
input '' (icFcExplanation),
input '' (icFcIdentification),
input '' (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BBusinessRelation>
end.
end.
end.