project QadFinancials > class BGrossIncomeAccounting > API query SelectGrossIncAcc


query filter (table tFilter)


tcBusinessFieldNametcDataTypetcOperator
iiCompanyIdi
tCostCentre1.CostCentreCodec=,>=,>,<>,<=,<,begins,can-do,matches
tCostCentre2.CostCentreCodec=,>=,>,<>,<=,<,begins,can-do,matches
tDivision1.DivisionCodec=,>=,>,<>,<=,<,begins,can-do,matches
tDivision3.DivisionCodec=,>=,>,<>,<=,<,begins,can-do,matches
tDivision2.DivisionCodec=,>=,>,<>,<=,<,begins,can-do,matches
tGL2.GLCodec=,>=,>,<>,<=,<,begins,can-do,matches
tGL3.GLCodec=,>=,>,<>,<=,<,begins,can-do,matches
tGL1.GLCodec=,>=,>,<>,<=,<,begins,can-do,matches
tGrossIncAcc.GrossIncAccIsAllCostCentrel=,<>
tGrossIncAcc.GrossIncAccIsAllDivisionl=,<>
tGrossIncAcc.GrossIncAccIsAllProjectl=,<>
tJournal.JournalCodec=,>=,>,<>,<=,<,begins,can-do,matches
tProject2.ProjectCodec=,>=,>,<>,<=,<,begins,can-do,matches
tProject1.ProjectCodec=,>=,>,<>,<=,<,begins,can-do,matches


Parameters (internal)


iiCompanyIdintegerCompany id


query condition


  each GrossIncAcc where
GrossIncAcc.Company_Id = iiCompanyId AND

      first CostCentre1 (conditional-join) where
CostCentre1.SharedSet_Id = vi_COSTCENTRE_sharedset(iiCompanyId) AND
CostCentre1.CostCentre_ID = GrossIncAcc.SalesCostCentre_ID AND

      first CostCentre2 (conditional-join) where
CostCentre2.SharedSet_Id = vi_COSTCENTRE_sharedset(iiCompanyId) AND
CostCentre2.CostCentre_ID = GrossIncAcc.TaxExpenseCostCentre_ID AND

      first Division1 (conditional-join) where
Division1.SharedSet_Id = vi_DIVISION_sharedset(iiCompanyId) AND
Division1.Division_ID = GrossIncAcc.SalesDivision_ID AND

      first Division2 (conditional-join) where
Division2.SharedSet_Id = vi_DIVISION_sharedset(iiCompanyId) AND
Division2.Division_ID = GrossIncAcc.TaxPayableDivision_ID AND

      first Division3 (conditional-join) where
Division3.SharedSet_Id = vi_DIVISION_sharedset(iiCompanyId) AND
Division3.Division_ID = GrossIncAcc.TaxExpenseDivision_ID AND

      first GL1 (inner-join) where
GL1.SharedSet_Id = vi_GL_sharedset(iiCompanyId) AND
GL1.GL_ID = GrossIncAcc.SalesGL_ID AND

      first GL2 (inner-join) where
GL2.SharedSet_Id = vi_GL_sharedset(iiCompanyId) AND
GL2.GL_ID = GrossIncAcc.TaxPayableGL_ID AND

      first GL3 (inner-join) where
GL3.SharedSet_Id = vi_GL_sharedset(iiCompanyId) AND
GL3.GL_ID = GrossIncAcc.TaxExpenseGL_ID AND

      first Journal (inner-join) where
Journal.SharedSet_Id = vi_JOURNAL_sharedset(iiCompanyId) AND
Journal.Journal_ID = GrossIncAcc.Journal_ID AND

      first Project2 (conditional-join) where
Project2.SharedSet_Id = vi_PROJECT_sharedset(iiCompanyId) AND
Project2.Project_ID = GrossIncAcc.TaxExpenseProject_ID AND

      first Project1 (conditional-join) where
Project1.SharedSet_Id = vi_PROJECT_sharedset(iiCompanyId) AND
Project1.Project_ID = GrossIncAcc.SalesProject_ID AND


query sort order


GL1.SalesGLCode (ascending)
Division1.SalesDivisionCode (ascending)
CostCentre1.SalesCostCentreCode (ascending)
Project1.SalesProjectCode (ascending)


query resultset tqSelectGrossIncAcc


field namedata typedb fielddescription
tiCompany_IDintegerGrossIncAcc.Company_IDLink to Company
tiGrossIncAcc_IDintegerGrossIncAcc.GrossIncAcc_IDRecord ID
tlGrossIncAccIsAllCostCentrelogicalGrossIncAcc.GrossIncAccIsAllCostCentreAll Cost Centers
tlGrossIncAccIsAllDivisionlogicalGrossIncAcc.GrossIncAccIsAllDivisionAll Sub-Accounts
tlGrossIncAccIsAllProjectlogicalGrossIncAcc.GrossIncAccIsAllProjectAll Projects
tiJournal_IDintegerGrossIncAcc.Journal_IDLink To Journal
tcJournalCodecharacterJournal.JournalCodeA daybook code (maximum eight characters).
tiSalesCostCentre_IDintegerGrossIncAcc.SalesCostCentre_IDLink To CostCentre (Sales)
tcSalesCostCentreCodecharacterCostCentre1.CostCentreCodeCost Center: A code that identifies the cost center.
tiSalesDivision_IDintegerGrossIncAcc.SalesDivision_IDLink To Division (Sales)
tcSalesDivisionCodecharacterDivision1.DivisionCodeSub-Account
tiSalesGL_IDintegerGrossIncAcc.SalesGL_IDLink To GL (Sales)
tcSalesGLCodecharacterGL1.GLCodeA code identifying the GL account.
tiSalesProject_IDintegerGrossIncAcc.SalesProject_IDLink To Project (Sales)
tcSalesProjectCodecharacterProject1.ProjectCodeProject
tiTaxExpenseCostCentre_IDintegerGrossIncAcc.TaxExpenseCostCentre_IDLink To CostCentre (Tax Expense)
tcTaxExpenseCostCentreCodecharacterCostCentre2.CostCentreCodeCost Center: A code that identifies the cost center.
tiTaxExpenseDivision_IDintegerGrossIncAcc.TaxExpenseDivision_IDLink To Division (Tax Expense)
tcTaxExpenseDivisionCodecharacterDivision3.DivisionCodeSub-Account
tiTaxExpenseGL_IDintegerGrossIncAcc.TaxExpenseGL_IDLink To GL (Tax Expense)
tcTaxExpenseGLCodecharacterGL3.GLCodeA code identifying the GL account.
tiTaxExpenseProject_IDintegerGrossIncAcc.TaxExpenseProject_IDLink To Project (Tax Expense)
tcTaxExpenseProjectCodecharacterProject2.ProjectCodeProject
tiTaxPayableDivision_IDintegerGrossIncAcc.TaxPayableDivision_IDLink To Division (Tax Payable)
tcTaxPayableDivisionCodecharacterDivision2.DivisionCodeSub-Account
tiTaxPayableGL_IDintegerGrossIncAcc.TaxPayableGL_IDLink To GL (Tax Payable)
tcTaxPayableGLCodecharacterGL2.GLCodeA code identifying the GL account.
GrossIncAccCustomcharactercalculatedcustom fields
GL1Customcharactercalculatedcustom fields
GL2Customcharactercalculatedcustom fields
GL3Customcharactercalculatedcustom fields
Division1Customcharactercalculatedcustom fields
Division2Customcharactercalculatedcustom fields
Division3Customcharactercalculatedcustom fields
CostCentre1Customcharactercalculatedcustom fields
CostCentre2Customcharactercalculatedcustom fields
Project1Customcharactercalculatedcustom fields
Project2Customcharactercalculatedcustom fields
JournalCustomcharactercalculatedcustom fields
ti_sequenceintegercalculatedprimary index
tc_rowidcharactercalculated = rowid(GrossIncAcc),rowid(CostCentre1),rowid(CostCentre2),rowid(Division1),rowid(Division2),rowid(Division3),rowid(GL1),rowid(GL2),rowid(GL3),rowid(Journal),rowid(Project2),rowid(Project1)


Internal usage


unused


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 = "BGrossIncomeAccounting".
create ttContext.
assign ttContext.propertyName = "methodName"
       ttContext.propertyValue = "SelectGrossIncAcc".
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/bgrossincomeaccounting.selectgrossincacc.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.