project QadFinancials > class BExpenseNote > API query SelectExpNote (optimised)


query filter (table tFilter)


tcBusinessFieldNametcDataTypetcOperator
iiCompanyIdi
tCreditor.CreditorCodec=,>=,>,<>,<=,<,begins,can-do,matches
tCurrency.CurrencyCodec=,>=,>,<>,<=,<,begins,can-do,matches
tEmployee.EmployeeCodec=,>=,>,<>,<=,<,begins,can-do,matches
tExpNote.ExpNoteConfirmationDatet=,>=,>,<>,<=,<
tExpNote.ExpNoteDescriptionc=,>=,>,<>,<=,<,begins,can-do,matches
tExpNote.ExpNoteNumberi=,>=,>,<>,<=,<
tExpNote.ExpNoteRateLCXCd=,>=,>,<>,<=,<
tExpNote.ExpNoteRateScaled=,>=,>,<>,<=,<
tExpNote.ExpNoteRegistrationDatet=,>=,>,<>,<=,<
tExpNote.ExpNoteStatusCodec=,>=,>,<>,<=,<,begins,can-do,matches
tExpNote.ExpNoteYeari=,>=,>,<>,<=,<
tUsr1.UsrNamec=,>=,>,<>,<=,<,begins,can-do,matches
tUsr2.UsrNamec=,>=,>,<>,<=,<,begins,can-do,matches


Parameters (internal)


iiCompanyIdintegerCompany id


query condition


  each ExpNote where
ExpNote.Company_Id = iiCompanyId AND

      first Currency (inner-join) where
Currency.Currency_ID = ExpNote.Currency_ID AND

      first Employee (inner-join) where
Employee.Company_Id = iiCompanyId AND
Employee.Employee_ID = ExpNote.Employee_ID AND

          first Creditor (inner-join) where
Creditor.SharedSet_Id = vi_CREDITOR_sharedset(iiCompanyId) AND
Creditor.Creditor_ID = Employee.Creditor_ID AND

      first Usr1 (conditional-join) where
Usr1.Usr_ID = ExpNote.ConfirmationUsr_ID AND

      first Usr2 (conditional-join) where
Usr2.Usr_ID = ExpNote.RegistrationUsr_ID AND


query sort order


ExpNote.Company_ID (ascending)
ExpNote.ExpNoteYear (ascending)
ExpNote.ExpNoteNumber (ascending)


query resultset tqSelectExpNote


field namedata typedb fielddescription
tiCompany_IDintegerExpNote.Company_IDLink to Company
tiConfirmationUsr_IDintegerExpNote.ConfirmationUsr_IDLink to Usr
tcCreditorCodecharacterCreditor.CreditorCodeSupplier Code
tiCurrency_IDintegerExpNote.Currency_IDCurrency Code
tcCurrencyCodecharacterCurrency.CurrencyCodeCurrency Code
tcCustomCombo0characterExpNote.CustomCombo0Custom Combo Field
tcCustomCombo1characterExpNote.CustomCombo1Custom Combo Field
tcCustomCombo2characterExpNote.CustomCombo2Custom Combo Field
tcCustomCombo3characterExpNote.CustomCombo3Custom Combo Field
tcCustomCombo4characterExpNote.CustomCombo4Custom Combo Field
tcCustomCombo5characterExpNote.CustomCombo5Custom Combo Field
tcCustomCombo6characterExpNote.CustomCombo6Custom Combo Field
tcCustomCombo7characterExpNote.CustomCombo7Custom Combo Field
tcCustomCombo8characterExpNote.CustomCombo8Custom Combo Field
tcCustomCombo9characterExpNote.CustomCombo9Custom Combo Field
ttCustomDate0dateExpNote.CustomDate0Custom Date Field
ttCustomDate1dateExpNote.CustomDate1Custom Date Field
ttCustomDate2dateExpNote.CustomDate2Custom Date Field
ttCustomDate3dateExpNote.CustomDate3Custom Date Field
ttCustomDate4dateExpNote.CustomDate4Custom Date Field
tdCustomDecimal0decimalExpNote.CustomDecimal0Custom Decimal Field
tdCustomDecimal1decimalExpNote.CustomDecimal1Custom Decimal Field
tdCustomDecimal2decimalExpNote.CustomDecimal2Custom Decimal Field
tdCustomDecimal3decimalExpNote.CustomDecimal3Custom Decimal Field
tdCustomDecimal4decimalExpNote.CustomDecimal4Custom Decimal Field
tiCustomInteger0integerExpNote.CustomInteger0Custom Integer Field
tiCustomInteger1integerExpNote.CustomInteger1Custom Integer Field
tiCustomInteger2integerExpNote.CustomInteger2Custom Integer Field
tiCustomInteger3integerExpNote.CustomInteger3Custom Integer Field
tiCustomInteger4integerExpNote.CustomInteger4Custom Integer Field
tcCustomLong0characterExpNote.CustomLong0Custom Long Field
tcCustomLong1characterExpNote.CustomLong1Custom Long Field
tcCustomNotecharacterExpNote.CustomNoteCustom Note Field
tcCustomShort0characterExpNote.CustomShort0Custom Short Field
tcCustomShort1characterExpNote.CustomShort1Custom Short Field
tcCustomShort2characterExpNote.CustomShort2Custom Short Field
tcCustomShort3characterExpNote.CustomShort3Custom Short Field
tcCustomShort4characterExpNote.CustomShort4Custom Short Field
tcCustomShort5characterExpNote.CustomShort5Custom Short Field
tcCustomShort6characterExpNote.CustomShort6Custom Short Field
tcCustomShort7characterExpNote.CustomShort7Custom Short Field
tcCustomShort8characterExpNote.CustomShort8Custom Short Field
tcCustomShort9characterExpNote.CustomShort9Custom Short Field
tiEmployee_IDintegerExpNote.Employee_IDEmployee Code
tcEmployeeCodecharacterEmployee.EmployeeCodeEmployee Code. A code that identifies an employee. The code cannot match any other employee in the current entity or any other entities in the current domain.
If you leave the Employee Code field blank, the system automatically generates a number for the record based on the sequence defined in Employee Autonumber Create.
tiExpNote_IDintegerExpNote.ExpNote_IDRecord ID
ttExpNoteConfirmationDatedateExpNote.ExpNoteConfirmationDateConfirmation Date
tcExpNoteDescriptioncharacterExpNote.ExpNoteDescriptionDescription
tiExpNoteNumberintegerExpNote.ExpNoteNumberNumber
tdExpNoteRateLCXCdecimalExpNote.ExpNoteRateLCXCBC xc Exchange Rate
tdExpNoteRateScaledecimalExpNote.ExpNoteRateScaleScale Factor
ttExpNoteRegistrationDatedateExpNote.ExpNoteRegistrationDateRegistration Date
tcExpNoteStatusCodecharacterExpNote.ExpNoteStatusCodeStatus
tiExpNoteYearintegerExpNote.ExpNoteYearYear
ttLastModifiedDatedateExpNote.LastModifiedDateLast Modified Date
tiLastModifiedTimeintegerExpNote.LastModifiedTimeLast Modified Time
tcLastModifiedUsercharacterExpNote.LastModifiedUserLast Modified User
tiRegistrationUsr_IDintegerExpNote.RegistrationUsr_IDLink to Usr
tcUsrNamecharacterUsr1.UsrNameUser Name
tcUsrName2characterUsr2.UsrNameUser Name
ExpNoteCustomcharactercalculatedcustom fields
CurrencyCustomcharactercalculatedcustom fields
EmployeeCustomcharactercalculatedcustom fields
CreditorCustomcharactercalculatedcustom fields
Usr1Customcharactercalculatedcustom fields
Usr2Customcharactercalculatedcustom fields
ti_sequenceintegercalculatedprimary index
tc_rowidcharactercalculated = rowid(ExpNote),rowid(Currency),rowid(Employee),rowid(Creditor),rowid(Usr1),rowid(Usr2)


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 = "BExpenseNote".
create ttContext.
assign ttContext.propertyName = "methodName"
       ttContext.propertyValue = "SelectExpNote".
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/bexpensenote.selectexpnote.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.