project QadFinancials > class BPosting > API query PostingLineForTransView

Description

Returns Posting lines and header data. Created for GL Transactions View Extended.


query filter (table tFilter)


tcBusinessFieldNametcDataTypetcOperator
iiCompanyIdi
icGLDesccmatches
ilBSAccountl=
icBatchNumberc=
icCostCenterCodec
icCostCenterDesccmatches
icCurrCodec=
icJournalCodec=
icJournalTypeCodec=
icJournalDesccmatches
icGLCodec
icGLCategoryc=
icGLTypeCodec=
icInterEntityCodec
icPostingDesccmatches
icProjectCodec
icProjectDesccmatches
icDivisionCodec
icDivisionDesccmatches
itPostingSystemDatet=
icVouchercmatches
idDebitTCd=
idCreditTCd=
itPostingDatet=
iiPostingYearPeriodFromi>=
iiPostingYearPeriodToi<=
icGLCodeDiffc
icGLCodeFromc>=
icGLCodeToc<=
icDivisionCodeFromc>=
icDivisionCodeToc<=
icDivisionCodeDiffc
icProjectCodeFromc>=
icProjectCodeToc<=
icProjectCodeDiffc
icCostCenterCodeFromc>=
icCostCenterCodeToc<=
icCostCenterCodeDiffc
itPostingDateFromt>=
itPostingDateTot<=
icLayerCodec=
icLayerTypeCodec=
iiPostingYearPeriodVali=
icInterEntityCodeDiff1c
icInterEntityCodeFrom1c>=
icInterEntityCodeTo1c<=
icPostingLineTextcmatches
tBusinessRelation.BusinessRelationICCodec=,>=,>,<>,<=,<,begins,can-do,matches
tCompany.CompanyCodec=,>=,>,<>,<=,<,begins,can-do,matches
tCostCentre.CostCentreCodec=,>=,>,<>,<=,<,begins,can-do,matches
tCostCentre.CostCentreDescriptionc=,>=,>,<>,<=,<,begins,can-do,matches
tCurrency.CurrencyCodec=,>=,>,<>,<=,<,begins,can-do,matches
tDivision.DivisionCodec=,>=,>,<>,<=,<,begins,can-do,matches
tDivision.DivisionDescriptionc=,>=,>,<>,<=,<,begins,can-do,matches
tGL.GLCategoryc=,>=,>,<>,<=,<,begins,can-do,matches
tGL.GLCodec=,>=,>,<>,<=,<,begins,can-do,matches
tGL.GLDescriptionc=,>=,>,<>,<=,<,begins,can-do,matches
tGL.GLIsBalanceAccountl=,<>
tGLOpenItem.GLOpenItemKeyc=,>=,>,<>,<=,<,begins,can-do,matches
tGL.GLTypeCodec=,>=,>,<>,<=,<,begins,can-do,matches
tJournal.JournalCodec=,>=,>,<>,<=,<,begins,can-do,matches
tJournal.JournalDescriptionc=,>=,>,<>,<=,<,begins,can-do,matches
tJournal.JournalTypeCodec=,>=,>,<>,<=,<,begins,can-do,matches
tLayer.LayerCodec=,>=,>,<>,<=,<,begins,can-do,matches
tLayer.LayerTypeCodec=,>=,>,<>,<=,<,begins,can-do,matches
tPosting.PostingBatchNumberc=,>=,>,<>,<=,<,begins,can-do,matches
tPosting.PostingDatet=,>=,>,<>,<=,<
tPosting.PostingInvoiceReferenceTxtc=,>=,>,<>,<=,<,begins,can-do,matches
tPosting.PostingIsReversingl=,<>
tPostingLine.PostingLineCreditCCd=,>=,>,<>,<=,<
tPostingLine.PostingLineCreditLCd=,>=,>,<>,<=,<
tPostingLine.PostingLineCreditTCd=,>=,>,<>,<=,<
tPostingLine.PostingLineDebitCCd=,>=,>,<>,<=,<
tPostingLine.PostingLineDebitLCd=,>=,>,<>,<=,<
tPostingLine.PostingLineDebitTCd=,>=,>,<>,<=,<
tPostingLine.PostingLineOriginLineNbri=,>=,>,<>,<=,<
tPostingLine.PostingLineTextc=,>=,>,<>,<=,<,begins,can-do,matches
tPosting.PostingOriginAddressCodec=,>=,>,<>,<=,<,begins,can-do,matches
tPosting.PostingOriginDaybookCodec=,>=,>,<>,<=,<,begins,can-do,matches
tPosting.PostingOriginDaybookNumberc=,>=,>,<>,<=,<,begins,can-do,matches
tPosting.PostingOriginDocumentc=,>=,>,<>,<=,<,begins,can-do,matches
tPosting.PostingOriginDocumentTypec=,>=,>,<>,<=,<,begins,can-do,matches
tPosting.PostingOriginIsExternall=,<>
tPosting.PostingOriginReferencec=,>=,>,<>,<=,<,begins,can-do,matches
tPosting.PostingOriginTransTypec=,>=,>,<>,<=,<,begins,can-do,matches
tPosting.PostingSystemDatet=,>=,>,<>,<=,<
tPosting.PostingTextc=,>=,>,<>,<=,<,begins,can-do,matches
tPosting.PostingVoucheri=,>=,>,<>,<=,<
tPosting.PostingYearPeriodi=,>=,>,<>,<=,<
tProject.ProjectCodec=,>=,>,<>,<=,<,begins,can-do,matches
tProject.ProjectDescriptionc=,>=,>,<>,<=,<,begins,can-do,matches
tUsr.UsrLoginc=,>=,>,<>,<=,<,begins,can-do,matches


Parameters (internal)


iiCompanyIdintegerCompany id
icGLDesccharacter
ilBSAccountlogical
icBatchNumbercharacter
icCostCenterCodecharacter
icCostCenterDesccharacter
icCurrCodecharacter
icJournalCodecharacter
icJournalTypeCodecharacter
icJournalDesccharacter
icGLCodecharacter
icGLCategorycharacter
icGLTypeCodecharacter
icInterEntityCodecharacter
icPostingDesccharacter
icProjectCodecharacter
icProjectDesccharacter
icDivisionCodecharacter
icDivisionDesccharacter
itPostingSystemDatedate
icVouchercharacter
idDebitTCdecimal
idCreditTCdecimal
itPostingDatedate
iiPostingYearPeriodFrominteger
iiPostingYearPeriodTointeger
icGLCodeDiffcharacter
icGLCodeFromcharacter
icGLCodeTocharacter
icDivisionCodeFromcharacter
icDivisionCodeTocharacter
icDivisionCodeDiffcharacter
icProjectCodeFromcharacter
icProjectCodeTocharacter
icProjectCodeDiffcharacter
icCostCenterCodeFromcharacter
icCostCenterCodeTocharacter
icCostCenterCodeDiffcharacter
itPostingDateFromdate
itPostingDateTodate
icLayerCodecharacter
icLayerTypeCodecharacter
iiPostingYearPeriodValinteger
icInterEntityCodeDiff1characterInterEntityCodeDiff1
icInterEntityCodeFrom1characterInterEntityCodeFrom1
icInterEntityCodeTo1characterInterEntityCodeTo1
icPostingLineTextcharacter


query condition


  each Posting where
Posting.Company_Id = iiCompanyId AND
Posting.PostingYearPeriod = iiPostingYearPeriodVal AND
Posting.PostingYearPeriod >= iiPostingYearPeriodFrom AND
Posting.PostingYearPeriod <= iiPostingYearPeriodTo AND
Posting.PostingDate = itPostingDate AND
Posting.PostingDate >= itPostingDateFrom AND
Posting.PostingDate <= itPostingDateTo AND
Posting.PostingSystemDate = itPostingSystemDate AND
Posting.PostingVoucher matches icVoucher AND
Posting.PostingBatchNumber = icBatchNumber AND
Posting.PostingText matches icPostingDesc

      first Journal (inner-join) where
Journal.SharedSet_Id = vi_JOURNAL_sharedset(iiCompanyId) AND
Journal.Journal_ID = Posting.Journal_ID AND
Journal.JournalCode = icJournalCode AND
Journal.JournalTypeCode = icJournalTypeCode AND
Journal.JournalDescription matches icJournalDesc

          first Layer (inner-join) where
Layer.Layer_ID = Journal.Layer_ID AND
Layer.LayerCode = icLayerCode AND
Layer.LayerTypeCode = icLayerTypeCode

      each PostingLine (inner-join) where
PostingLine.Company_Id = iiCompanyId AND
PostingLine.Posting_ID = Posting.Posting_ID AND
PostingLine.PostingLineDebitTC = idDebitTC AND
PostingLine.PostingLineCreditTC = idCreditTC AND
PostingLine.PostingLineText matches icPostingLineText

          first BusinessRelation (conditional-join) where
BusinessRelation.BusinessRelation_ID = PostingLine.IntercoBusinessRelation_ID AND
BusinessRelation.BusinessRelationICCode >= icInterEntityCodeFrom1 AND
BusinessRelation.BusinessRelationICCode <= icInterEntityCodeTo1 AND
BusinessRelation.BusinessRelationICCode <> (if icInterEntityCodeDiff1 = '-999999' then '' else icInterEntityCodeDiff1) AND
BusinessRelation.BusinessRelationICCode matches (if icInterEntityCode = '-999999' then '' else icInterEntityCode)

          first Company (inner-join) where
Company.Company_Id = iiCompanyId AND
Company.Company_ID = PostingLine.Company_ID AND

          first CostCentre (conditional-join) where
CostCentre.SharedSet_Id = vi_COSTCENTRE_sharedset(iiCompanyId) AND
CostCentre.CostCentre_ID = PostingLine.CostCentre_ID AND
CostCentre.CostCentreCode matches (if icCostCenterCode = '-999999' then '' else icCostCenterCode) AND
CostCentre.CostCentreCode >= icCostCenterCodeFrom AND
CostCentre.CostCentreCode <= icCostCenterCodeTo AND
CostCentre.CostCentreCode <> (if icCostCenterCodeDiff = '-999999' then '' else icCostCenterCodeDiff) AND
CostCentre.CostCentreDescription matches icCostCenterDesc

          first Currency (inner-join) where
Currency.Currency_ID = PostingLine.Currency_ID AND
Currency.CurrencyCode = icCurrCode

          first Division (conditional-join) where
Division.SharedSet_Id = vi_DIVISION_sharedset(iiCompanyId) AND
Division.Division_ID = PostingLine.Division_ID AND
Division.DivisionCode matches (if icDivisionCode = '-999999' then '' else icDivisionCode) AND
Division.DivisionCode >= icDivisionCodeFrom AND
Division.DivisionCode <= icDivisionCodeTo AND
Division.DivisionCode <> (if icDivisionCodeDiff = '-999999' then '' else icDivisionCodeDiff) AND
Division.DivisionDescription matches icDivisionDesc

          first GL (inner-join) where
GL.SharedSet_Id = vi_GL_sharedset(iiCompanyId) AND
GL.GL_ID = PostingLine.GL_ID AND
GL.GLCode matches (if icGLCode = '-999999' then '' else icGLCode) AND
GL.GLCode >= icGLCodeFrom AND
GL.GLCode <= icGLCodeTo AND
GL.GLCode <> (if icGLCodeDiff = '-999999' then '' else icGLCodeDiff) AND
GL.GLCategory = icGLCategory AND
GL.GLTypeCode = icGLTypeCode AND
GL.GLIsBalanceAccount = ilBSAccount AND
GL.GLDescription matches icGLDesc

          each GLOpenItemMovement (outer-join) where
GLOpenItemMovement.PostingLine_ID = PostingLine.PostingLine_ID AND

              first GLOpenItem (outer-join) where
GLOpenItem.Company_Id = iiCompanyId AND
GLOpenItem.GLOpenItem_ID = GLOpenItemMovement.GLOpenItem_ID AND

          first Project (conditional-join) where
Project.SharedSet_Id = vi_PROJECT_sharedset(iiCompanyId) AND
Project.Project_ID = PostingLine.Project_ID AND
Project.ProjectCode matches (if icProjectCode = '-999999' then '' else icProjectCode) AND
Project.ProjectCode >= icProjectCodeFrom AND
Project.ProjectCode <= icProjectCodeTo AND
Project.ProjectCode <> (if icProjectCodeDiff = '-999999' then '' else icProjectCodeDiff) AND
Project.ProjectDescription matches icProjectDesc

      first Usr (inner-join) where
Usr.Usr_ID = Posting.CreatorUsr_ID AND


query resultset tqPostingLineForTransView


field namedata typedb fielddescription
tcBusinessRelationICCodecharacterBusinessRelation.BusinessRelationICCodeIntercompany Code. When Intercompany is true, this field is mandatory.
The code entered here must match the intercompany code entered for GL accounts in order to generate intercompany reports.
The intercompany code must be unique for this business relation.
tiCompany_IDintegerPostingLine.Company_IDLink to Company
tcCompanyCodecharacterCompany.CompanyCodeEntity Code
tiCostCentre_IDintegerCostCentre.CostCentre_IDRecord ID
tcCostCentreCodecharacterCostCentre.CostCentreCodeCost Center: A code that identifies the cost center.
tcCostCentreDescriptioncharacterCostCentre.CostCentreDescriptionDescription: a brief description of the cost center.
tiCreatorUsr_IDintegerPosting.CreatorUsr_IDLogin
tiCrossCompany_IDintegerPostingLine.CrossCompany_IDLink to Company
tiCurrency_IDintegerPostingLine.Currency_IDCurrency Code
tcCurrencyCodecharacterCurrency.CurrencyCodeCurrency Code
tcCustomShort0characterPostingLine.CustomShort0Custom Short Field
tcCustomShort1characterPostingLine.CustomShort1Custom Short Field
tcCustomShort2characterPostingLine.CustomShort2Custom Short Field
tcCustomShort3characterPostingLine.CustomShort3Custom Short Field
tcCustomShort4characterPostingLine.CustomShort4Custom Short Field
tcCustomShort5characterPostingLine.CustomShort5Custom Short Field
tiDivision_IDintegerDivision.Division_IDRecord ID
tcDivisionCodecharacterDivision.DivisionCodeSub-Account
tcDivisionDescriptioncharacterDivision.DivisionDescriptionDescription
tiGL_IDintegerGL.GL_IDRecord ID
tcGLCategorycharacterGL.GLCategoryCategory: A code for classifying the account based on its function on financial statements.
tcGLCodecharacterGL.GLCodeA code identifying the GL account.
tcGLDescriptioncharacterGL.GLDescriptionA description of the GL account.
tlGLIsBalanceAccountlogicalGL.GLIsBalanceAccountThis field will be calculated by the system based on the value of tcBalance.
If the account is a Balance Sheet account the value will be true, if it is a Profit and Loss account then it will be false.
api annotation:This field can be left blank as it will be calculated by the system.
tcGLOpenItemKeycharacterGLOpenItem.GLOpenItemKeyAllocation Key
tiGLOpenItemMovement_IDintegerGLOpenItemMovement.GLOpenItemMovement_IDRecord ID
tcGLTypeCodecharacterGL.GLTypeCodeA code identifying the type of account.
tiJournal_IDintegerJournal.Journal_IDRecord ID
tcJournalCodecharacterJournal.JournalCodeA daybook code (maximum eight characters).
tcJournalDescriptioncharacterJournal.JournalDescriptionA brief description of the daybook.
api annotation:Value for this field defaults to null.
tcJournalTypeCodecharacterJournal.JournalTypeCodeA daybook type code.
api annotation:Value for this field defaults to "Journal Entries".
tcJournalTypeCodeTrcharactercalculatedJournalTypeCodeTr: obsolete calc-field as this field is no longer used by the callers but we cannot delete it either as that would break the backwards-compatibility
tcLayerCodecharacterLayer.LayerCodeLayer Code
tcLayerTypeCodecharacterLayer.LayerTypeCodeLayer Type
tiObsoleteClosing_IDintegerPosting.ObsoleteClosing_IDLink to Closing
tiPeriod_IDintegerPosting.Period_IDLink to Period
tiPosting_IDintegerPostingLine.Posting_IDLink to Posting
tcPostingBatchNumbercharacterPosting.PostingBatchNumberSome financial input programs allow you to enter a batch number and to keep a control total on the screen of all the transactions entered with the same batch number.
api annotation:Not applicable for application integration.
ttPostingDatedatePosting.PostingDateThe accounting date on which the journal entry is posted. The posting date must be a valid calendar date and must be within the GL calendar year (PostingYear) and period (PostingPeriod).
tcPostingInvoiceReferenceTxtcharacterPosting.PostingInvoiceReferenceTxtWhen the posting is part of an invoice posting, then this field contains the invoice number (Year/Daybook/Voucher extended with supplier invoice Reference in case of a supplier invoice). Used for information purpose on reports and browsers.
api annotation:Value for this field defaults to blank
tlPostingIsReversinglogicalPosting.PostingIsReversingIndicate whether the posting is a reversal of an existing posting.
api annotation:Value for this field defaults to "false".
tiPostingLine_IDintegerPostingLine.PostingLine_IDRecord ID
tdPostingLineCreditCCdecimalPostingLine.PostingLineCreditCCSC Credit
api annotation:Partial Update = yes - it will get a default value depending on the value of PostingLinCreditTC, PostingLineCCRate & PostingLineCCScale.
SC Amount = TC Amount * Exchange rate (TC/SC) * Scale Factor (TC/SC). If Partial Update is false, you should enter the correct value for this field
tdPostingLineCreditLCdecimalPostingLine.PostingLineCreditLCBC Credit
api annotation:Partial Update = yes - it will get a default value depends on the value of PostingLineCreditTC, PostingLineExchangeRate & PostingLineRateScale.
BC Amount = TC Amount * Exchange rate (TC/BC) * Scale Factor (TC/BC). If Partial Update is false, enter a value for this field.
tdPostingLineCreditTCdecimalPostingLine.PostingLineCreditTCTC Credit
tdPostingLineDebitCCdecimalPostingLine.PostingLineDebitCCSC Debit
api annotation:Partial Update = yes - it will get a default value depending on the value of PostingLineDebitTC, PostingLineCCRate & PostingLineCCScale.
SC Amount = TC Amount * Exchange rate (TC/SC) * Scale Factor (TC/SC). If Partial Update is false, enter the correct value for this field.
tdPostingLineDebitLCdecimalPostingLine.PostingLineDebitLCBC Debit
api annotation:Partial Update = yes - it will get a default value depending on the value of PostingLineDebitTC, PostingLineExchangeRate and PostingLineRateScale.
BC Amount = TC Amount * Exchange rate (TC/BC) * Scale Factor (TC/BC). If Partial Update = false, enter the correct value into this field.
tdPostingLineDebitTCdecimalPostingLine.PostingLineDebitTCTC Debit
tiPostingLineOriginLineNbrintegerPostingLine.PostingLineOriginLineNbrEquivalent to PostingLineSequence, however there is a difference in format and the value may differ in a number of specific cases.
MfgPro Equivalent: glt_line
api annotation:Value for this field defaults to 0.
tcPostingLineTextcharacterPostingLine.PostingLineTextDescription
api annotation:Value for this field defaults to blank. Note: if a new record is created through the user interface, the default value is as same as the value of "PostingText" of tPosting.
tcPostingOriginAddressCodecharacterPosting.PostingOriginAddressCodeFor invoices created with Invoice Post and Print, the address code of the bill-to customer is stored in this field.
tcPostingOriginDaybookCodecharacterPosting.PostingOriginDaybookCodeDaybook Code (normally this corresponds with our JournalCode)
MfgPro equivalent: glt_dy_code
tcPostingOriginDaybookNumbercharacterPosting.PostingOriginDaybookNumberDaybook Number (normally this corresponds with our PostingVoucher)
MfgPro equivalent: glt_dy_num
tcPostingOriginDocumentcharacterPosting.PostingOriginDocumentTransaction History Number (Inventory or Operations) or Invoice Number (Sales Order)
MfgPro equivalent: glt_doc
tcPostingOriginDocumentTypecharacterPosting.PostingOriginDocumentTypeDocument Type (I for Invoice, OP for Work Orders)
MfgPro equivalent: glt_doc_type
tlPostingOriginIsExternallogicalPosting.PostingOriginIsExternalIndicate whether the posting is from an External Origin. When creating cross company postings, set this to true.
api annotation:Value for this field defaults to false.
tcPostingOriginReferencecharacterPosting.PostingOriginReferenceGL Reference Number. Format is ZZYYMMDD999999 where ZZ = module (IC, SO, WO) YY = Year, MM = Month, DD = Day, 999999 = Running Journal Number.
MfgPro equivalent: glt_ref
tcPostingOriginTransTypecharacterPosting.PostingOriginTransTypeSystem generated code used to identify a transaction (IC for Inventory, WO for Work Orders, SO for Sales Orders, FA for Fixed Assets)
MfgPro equivalent: glt_tr_type
ttPostingSystemDatedatePosting.PostingSystemDateThe system date of the posting corresponding to "PostingDate".
api annotation:In Create mode, when Partial Update = yes - this field gets a default value which is the current date of the system.
tcPostingTextcharacterPosting.PostingTextFree text describing the posting.
api annotation:Value for this field defaults to blank
tiPostingVoucherintegerPosting.PostingVoucherVoucher is a sequential number that uniquely identifies the journal entry (within the combination of an entity and a daybook code).
api annotation:In create mode,enter 0 in this field - the voucher number is generated by the system. In Modify/Delete, the correct voucher number must be entered because this identifies the record.
tiPostingYearPeriodintegerPosting.PostingYearPeriodThe GL calendar year/period for the posting. This field is determined by "PostingPeriod" and "PostingYear".
api annotation:If Partial Update is true, the value defaults using PostingPeriod and PostingYear.
tiProject_IDintegerProject.Project_IDRecord ID
tcProjectCodecharacterProject.ProjectCodeProject
tcProjectDescriptioncharacterProject.ProjectDescriptionDescription
tcUsrLogincharacterUsr.UsrLoginLogin
PostingCustomcharactercalculatedcustom fields
PostingLineCustomcharactercalculatedcustom fields
CompanyCustomcharactercalculatedcustom fields
GLCustomcharactercalculatedcustom fields
JournalCustomcharactercalculatedcustom fields
LayerCustomcharactercalculatedcustom fields
CurrencyCustomcharactercalculatedcustom fields
UsrCustomcharactercalculatedcustom fields
DivisionCustomcharactercalculatedcustom fields
CostCentreCustomcharactercalculatedcustom fields
ProjectCustomcharactercalculatedcustom fields
BusinessRelationCustomcharactercalculatedcustom fields
GLOpenItemMovementCustomcharactercalculatedcustom fields
GLOpenItemCustomcharactercalculatedcustom fields
ti_sequenceintegercalculatedprimary index
tc_rowidcharactercalculated = rowid(Posting),rowid(Journal),rowid(Layer),rowid(PostingLine),rowid(BusinessRelation),rowid(Company),rowid(CostCentre),rowid(Currency),rowid(Division),rowid(GL),rowid(GLOpenItemMovement),rowid(GLOpenItem),rowid(Project),rowid(Usr)


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 = "BPosting".
create ttContext.
assign ttContext.propertyName = "methodName"
       ttContext.propertyValue = "PostingLineForTransView".
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/bposting.postinglinefortransview.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.