project QadFinancials > class BSaf > API query SafByCodeIDActiveConcept (optimised)
Description
Get Safs with some input paramaters
query filter (table tFilter)
tcBusinessFieldName | tcDataType | tcOperator |
icSafCode | c | = |
icSafConceptCode | c | = |
iiSafID | i | = |
ilSafIsActive | l | = |
iiSafConceptID | i | = |
iiBudgetGroupID | i | = |
icBudgetGroupCode | c | = |
tBudgetGroup.BudgetGroupCode | c | =,>=,>,<>,<=,<,begins,can-do,matches |
tSaf.SafCode | c | =,>=,>,<>,<=,<,begins,can-do,matches |
tSafConcept.SafConceptCode | c | =,>=,>,<>,<=,<,begins,can-do,matches |
tSaf.SafDescription | c | =,>=,>,<>,<=,<,begins,can-do,matches |
tSaf.SafIsActive | l | =,<> |
Parameters (internal)
icSafCode | character | SAF Code |
icSafConceptCode | character | SAF Concept Code |
iiSafID | integer | SafID |
ilSafIsActive | logical | SafIsActive |
iiSafConceptID | integer | SafConceptId |
iiBudgetGroupID | integer | BudgetGroupID |
icBudgetGroupCode | character | BudgetGroupCode |
query condition
each Saf where
Saf.SafCode = icSafCode AND
Saf.Saf_ID = iiSafID AND
Saf.SafIsActive = ilSafIsActive AND
Saf.BudgetGroup_ID = iiBudgetGroupID AND
Saf.SafConcept_ID = iiSafConceptID
first BudgetGroup (conditional-join) where
BudgetGroup.BudgetGroup_ID = Saf.BudgetGroup_ID AND
BudgetGroup.BudgetGroupCode = icBudgetGroupCode
first SafConcept (inner-join) where
SafConcept.SafConcept_ID = Saf.SafConcept_ID AND
SafConcept.SafConceptCode = icSafConceptCode
query sort order
Saf.SafCode (ascending)
query resultset tqSafByCodeIDActiveConcept
field name | data type | db field | description |
tcCustomCombo0 | character | Saf.CustomCombo0 | Custom Combo Field |
tcCustomCombo1 | character | Saf.CustomCombo1 | Custom Combo Field |
tcCustomCombo2 | character | Saf.CustomCombo2 | Custom Combo Field |
tcCustomCombo3 | character | Saf.CustomCombo3 | Custom Combo Field |
tcCustomCombo4 | character | Saf.CustomCombo4 | Custom Combo Field |
tcCustomCombo5 | character | Saf.CustomCombo5 | Custom Combo Field |
tcCustomCombo6 | character | Saf.CustomCombo6 | Custom Combo Field |
tcCustomCombo7 | character | Saf.CustomCombo7 | Custom Combo Field |
tcCustomCombo8 | character | Saf.CustomCombo8 | Custom Combo Field |
tcCustomCombo9 | character | Saf.CustomCombo9 | Custom Combo Field |
ttCustomDate0 | date | Saf.CustomDate0 | Custom Date Field |
ttCustomDate1 | date | Saf.CustomDate1 | Custom Date Field |
ttCustomDate2 | date | Saf.CustomDate2 | Custom Date Field |
ttCustomDate3 | date | Saf.CustomDate3 | Custom Date Field |
ttCustomDate4 | date | Saf.CustomDate4 | Custom Date Field |
tdCustomDecimal0 | decimal | Saf.CustomDecimal0 | Custom Decimal Field |
tdCustomDecimal1 | decimal | Saf.CustomDecimal1 | Custom Decimal Field |
tdCustomDecimal2 | decimal | Saf.CustomDecimal2 | Custom Decimal Field |
tdCustomDecimal3 | decimal | Saf.CustomDecimal3 | Custom Decimal Field |
tdCustomDecimal4 | decimal | Saf.CustomDecimal4 | Custom Decimal Field |
tiCustomInteger0 | integer | Saf.CustomInteger0 | Custom Integer Field |
tiCustomInteger1 | integer | Saf.CustomInteger1 | Custom Integer Field |
tiCustomInteger2 | integer | Saf.CustomInteger2 | Custom Integer Field |
tiCustomInteger3 | integer | Saf.CustomInteger3 | Custom Integer Field |
tiCustomInteger4 | integer | Saf.CustomInteger4 | Custom Integer Field |
tcCustomLong0 | character | Saf.CustomLong0 | Custom Long Field |
tcCustomLong1 | character | Saf.CustomLong1 | Custom Long Field |
tcCustomNote | character | Saf.CustomNote | Custom Note Field |
tcCustomShort0 | character | Saf.CustomShort0 | Custom Short Field |
tcCustomShort1 | character | Saf.CustomShort1 | Custom Short Field |
tcCustomShort2 | character | Saf.CustomShort2 | Custom Short Field |
tcCustomShort3 | character | Saf.CustomShort3 | Custom Short Field |
tcCustomShort4 | character | Saf.CustomShort4 | Custom Short Field |
tcCustomShort5 | character | Saf.CustomShort5 | Custom Short Field |
tcCustomShort6 | character | Saf.CustomShort6 | Custom Short Field |
tcCustomShort7 | character | Saf.CustomShort7 | Custom Short Field |
tcCustomShort8 | character | Saf.CustomShort8 | Custom Short Field |
tcCustomShort9 | character | Saf.CustomShort9 | Custom Short Field |
tcQADC01 | character | Saf.QADC01 | unused QAD reserved field |
tcQADC02 | character | Saf.QADC02 | unused QAD reserved field |
tdQADD01 | decimal | Saf.QADD01 | unused QAD reserved field |
ttQADT01 | date | Saf.QADT01 | unused QAD reserved field |
tiSaf_ID | integer | Saf.Saf_ID | Record ID |
tcSafCode | character | Saf.SafCode | SAF Code |
tcSafDescription | character | Saf.SafDescription | SAF Description |
tlSafIsActive | logical | Saf.SafIsActive | Active |
tiSafConcept_ID | integer | Saf.SafConcept_ID | SAF Concept Code |
tcSafConceptCode | character | SafConcept.SafConceptCode | SAF Concept Code |
tiBudgetGroup_ID | integer | Saf.BudgetGroup_ID | Budget Group |
tcBudgetGroupCode | character | BudgetGroup.BudgetGroupCode | Budget Group |
SafCustom | character | calculated | custom fields |
BudgetGroupCustom | character | calculated | custom fields |
SafConceptCustom | character | calculated | custom fields |
ti_sequence | integer | calculated | primary index |
tc_rowid | character | calculated | = rowid(Saf),rowid(BudgetGroup),rowid(SafConcept) |
Internal usage
QadFinancials
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 = "BSaf".
create ttContext.
assign ttContext.propertyName = "methodName"
ttContext.propertyValue = "SafByCodeIDActiveConcept".
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/bsaf.safbycodeidactiveconcept.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.