project QadFinancials > class BBusinessRelation > API query BusinessRelationByIdCode

Description

to get some fields of business relation
Parameters : id or code


query filter (table tFilter)


tcBusinessFieldNametcDataTypetcOperator
iiBusinessRelationIdi=
icBusinessRelationCodecmatches
tBusinessRelation.BusinessRelationAVRCodec=,>=,>,<>,<=,<,begins,can-do,matches
tBusinessRelation.BusinessRelationCodec=,>=,>,<>,<=,<,begins,can-do,matches
tBusinessRelation.BusinessRelationIsActivel=,<>
tBusinessRelation.BusinessRelationIsCompensl=,<>
tBusinessRelation.BusinessRelationIsInCompl=,<>
tBusinessRelation.BusinessRelationIsIntercol=,<>
tBusinessRelation.BusinessRelationIsLastFilll=,<>
tBusinessRelation.BusinessRelationIsTaxRepl=,<>
tBusinessRelation.BusinessRelationName1c=,>=,>,<>,<=,<,begins,can-do,matches
tBusinessRelation.BusinessRelationName2c=,>=,>,<>,<=,<,begins,can-do,matches
tBusinessRelation.BusinessRelationNameCtrlc=,>=,>,<>,<=,<,begins,can-do,matches
tBusinessRelation.BusinessRelationSearchNamec=,>=,>,<>,<=,<,begins,can-do,matches
tLng.LngCodec=,>=,>,<>,<=,<,begins,can-do,matches


Parameters (internal)


iiBusinessRelationIdinteger
icBusinessRelationCodecharacterBusiness Relation Code


query condition


  each BusinessRelation where
BusinessRelation.BusinessRelation_ID = iiBusinessRelationID AND
BusinessRelation.BusinessRelationCode matches icBusinessRelationCode

      first Lng (inner-join) where
Lng.Lng_ID = BusinessRelation.Lng_ID AND


query sort order


BusinessRelation.BusinessRelation_ID (ascending)


query resultset tqBusinessRelationByIdCode


field namedata typedb fielddescription
tiBusinessRelation_IDintegerBusinessRelation.BusinessRelation_IDRecord ID
tcBusinessRelationAVRCodecharacterBusinessRelation.BusinessRelationAVRCodeObsolete field
tcBusinessRelationCodecharacterBusinessRelation.BusinessRelationCodeBusiness Relation. A code to identify the business relation.
If this field does not have a input from the user, the system automatically generates a number for the record based on the sequence defined in Business Relation Autonumber Create.
tlBusinessRelationIsActivelogicalBusinessRelation.BusinessRelationIsActiveActive: This field indicates if this is an active record.
api annotation:PartialUpdate = yes - defaults to true.
tlBusinessRelationIsCompenslogicalBusinessRelation.BusinessRelationIsCompensCustomer/Supplier Compensation Allowed. This filed indicates how open items should be managed during payment processing when a customer and supplier are both associated with this business relation.
api annotation:PartialUpdate = yes - defaults to false.
tlBusinessRelationIsInComplogicalBusinessRelation.BusinessRelationIsInCompInternal Entity. This filed indicates if the business relation identifies one of your entities within this database.
If this is an internal entity, you can also update the Tax Report, Name Control, and Last Filing fields, which are used for filing 1099-MISC reports in the US.
api annotation:PartialUpdate = yes - defaults to false.
For internal entities, this field defaults to yes and cannot be changed.
tlBusinessRelationIsIntercologicalBusinessRelation.BusinessRelationIsIntercoIntercompany. This field Indicates if the business relation identifies an entity that is a member of a group of entities that trade with each other.
If the business relation is identified as an internal entity,this field is true and cannot be changed.
api annotation:PartialUpdate = yes - defaults to false.
tlBusinessRelationIsLastFilllogicalBusinessRelation.BusinessRelationIsLastFillLast Filing. For an internal company, this field indicates whether this is the last time your company is filing a 1099-MISC under its current taxpayer ID number.
api annotation:PartialUpdate = yes - defaults to false.
tlBusinessRelationIsTaxReplogicalBusinessRelation.BusinessRelationIsTaxRepTax Report. For an internal company,this filed indicates whether to use this address for 1099 tax reporting.
When this field is yes, the name, first line of the street address, city, state, zip code, telephone number, and federal tax ID for the headoffice address must not be blank.
api annotation:PartialUpdate = yes - defaults to false.
tcBusinessRelationName1characterBusinessRelation.BusinessRelationName1Name: The full name of the business relation.
This field sets the default name for linked addresses such as customers and suppliers.
api annotation:PartialUpdate = yes - defaults to the BusinessRelationCode.
tcBusinessRelationName2characterBusinessRelation.BusinessRelationName2Second Name. An extended name when the Name field is not large enough to contain all information.
This fielsd can be blank.
tcBusinessRelationNameCtrlcharacterBusinessRelation.BusinessRelationNameCtrlName Control. For an internal company, the value is the IRS magnetic media control code assigned to this company.
When Tax Report is selected, a warning displays when this field is blank.
tcBusinessRelationSearchNamecharacterBusinessRelation.BusinessRelationSearchNameSearch Name: An alternate name for finding the business relation. This field can be useful for sorting and filtering.
api annotation:PartialUpdate = yes - defaults to the BusinessRelationCode.
tiCorporateGroup_IDintegerBusinessRelation.CorporateGroup_IDGroup Name
tiLng_IDintegerBusinessRelation.Lng_IDLanguage Code
tcLngCodecharacterLng.LngCodeLanguage Code
BusinessRelationCustomcharactercalculatedcustom fields
LngCustomcharactercalculatedcustom fields
ti_sequenceintegercalculatedprimary index
tc_rowidcharactercalculated = rowid(BusinessRelation),rowid(Lng)


Internal usage


QadFinancials
method BCreditor.ApiLoadCreditor
method BCreditor.ApiLoadCreditorV01
method BCreditor.Calculate
method BCreditor.ValBusinessRelation
method BCreditor.ValidateComponent
method BDCollection.ExportDOM80
method BDCollection.ExportLCRBOR
method BDebtor.ApiLoadDebtor
method BDebtor.ValBusinessRelation
method BDebtor.ValidateComponent
method BEmployee.ApiBusinessRelationInfo
method BGL.ValBusinessRelation
method BMfgAddress.ApiGetDockAddress
method BMfgAddress.ApiGetHeadOfficeAddress
method BMfgAddress.UpdateMfgData
method BMfgCustomer.UpdateMfgData
method BMfgSupplier.UpdateMfgData


Sample code: how to call this query through RPCRequestService (QXtend Inbound)

define temp-table ttContext no-undo
    field propertyQualifier as character
    field propertyName as character
    field propertyValue as character
    index entityContext is primary unique
        propertyQualifier
        propertyName
    index propertyQualifier
        propertyQualifier.

define dataset dsContext for ttContext.

define variable vhContextDS as handle no-undo.
define variable vhExceptionDS as handle no-undo.
define variable vhServer as handle no-undo.
define variable vhInputDS as handle no-undo.
define variable vhInputOutputDS as handle no-undo.
define variable vhOutputDS as handle no-undo.
define variable vhParameter as handle no-undo.

/* Create context */
create ttContext.
assign ttContext.propertyName = "programName"
       ttContext.propertyValue = "BBusinessRelation".
create ttContext.
assign ttContext.propertyName = "methodName"
       ttContext.propertyValue = "BusinessRelationByIdCode".
create ttContext.
assign ttContext.propertyName = "applicationId"
       ttContext.propertyValue = "fin".
create ttContext.
assign ttContext.propertyName = "entity"
       ttContext.propertyValue = "1000".
create ttContext.
assign ttContext.propertyName = "userName"
       ttContext.propertyValue = "mfg".
create ttContext.
assign ttContext.propertyName = "password"
       ttContext.propertyValue = "".

/* Create input dataset */
create dataset vhInputDS.
vhInputDS:read-xmlschema("file", "xml/bbusinessrelation.businessrelationbyidcode.i.xsd", ?).
vhParameter = vhInputDS:get-buffer-handle("tParameterI").
vhParameter:buffer-create().

assign vhParameter::icRange = "A"
       vhParameter::icRowid = ""
       vhParameter::iiRownum = 0
       vhParameter::iiNumber = 5 /* Number of records to read */
       vhParameter::icSortColumns = ""
       vhParameter::ilCountOnly = false
       vhParameter::ilForwardRead = true
       vhParameter::iiMaximumBrowseRecordsToCount = 0.

vhParameter = vhInputDS:get-buffer-handle("tFilter").
vhParameter:buffer-create().

assign vhParameter::<field-name-1> = <field-value-1>
       vhParameter::<field-name-2> = <field-value-2>
       ...

/* Connect the AppServer */
create server vhServer.
vhServer:connect("-URL <appserver-url>").

if not vhServer:connected()
then do:
    message "Could not connect AppServer" view-as alert-box error title "Error".
    return.
end.

/* Run */
assign vhContextDS = dataset dsContext:handle.

run program/rpcrequestservice.p on vhServer
    (input-output dataset-handle vhContextDS by-reference,
           output dataset-handle vhExceptionDS,
     input        dataset-handle vhInputDS by-reference,
     input-output dataset-handle vhInputOutputDS by-reference,
           output dataset-handle vhOutputDS).

/* Handle output however you want, in this example, we dump it to xml */
if valid-handle(vhExceptionDS)
then vhExceptionDS:write-xml("file", "Exceptions.xml", true).

if valid-handle(vhOutputDS)
then vhOutputDS:write-xml("file", "Output.xml", true).

/* Cleanup */
vhServer:disconnect().
assign vhServer = ?.

if valid-handle(vhInputDS)
then delete object vhInputDS.

if valid-handle(vhOutputDS)
then delete object vhOutputDS.

if valid-handle(vhExceptionDS)
then delete object vhExceptionDS.