project QadFinancials > class BClosingPostingsReport > method GetBusinessFields

Description

This method is used to get report result dataset structure according to specific method name.


Parameters


icReferenceinputcharacter- <classname> for receiving business field information of a business class
- <classname>.<methodname> for receiving business field information of a browse or report
tBusinessFieldsoutputtemp-table
tCustomRelationoutputtemp-table
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program/bclosingpostingsreport.p)

<ANCESTOR-CODE>

/*PeriodYaer for all reports*/
if not can-do("VoucherCompleteness":U, icReference)
then do:
    create tBusinessFields.
    assign tBusinessFields.tcSideLabel     = trim(#T-1'GL Cal Year':30(1274)T-1#)
           tBusinessFields.tcFcDescription = trim(#T-2'GL Cal Year':100(1275)T-2#)
           tBusinessFields.tcFcFieldName   = "PeriodYear":U
           tBusinessFields.tcDataType      = "i":U
           tBusinessFields.tcControlType   = "NumericInt":U
           tBusinessFields.tcDisplayFormat = "9999":U
           tBusinessFields.tcFcFieldType   = "F":U.
    /*PeriodPeriod for all reports*/
    create tBusinessFields.
    assign tBusinessFields.tcSideLabel     = trim(#T-3'GL Period':30(1276)T-3#)
           tBusinessFields.tcFcDescription = trim(#T-4'GL Period':100(1277)T-4#)
           tBusinessFields.tcFcFieldName   = "PeriodPeriod":U
           tBusinessFields.tcDataType      = "i":U
           tBusinessFields.tcControlType   = "NumericInt":U
           tBusinessFields.tcDisplayFormat = "99":U
           tBusinessFields.tcFcFieldType   = "F":U.
end.  

if can-do("JournalEntryBalance,RecurringEntries,AccUnmarkedTransactions,AllocationCheck,CreditorControlGLBalance,DebtorControlGLBalance,GLOpenItemControl,VoucherCompleteness":U,icReference)
then do:
    /* Company */
    assign vcCompanyList = "":U.
    <Q-96 run CompanyByDomain (all) (Read) (NoCache)
       (input ?, (CompanyId)
        input ?, (DomainId)
        input ?, (Active)
        output dataset tqCompanyByDomain) in BCompany >

    for each tqCompanyByDomain
        break by tqCompanyByDomain.tcCompanyCode:
        if first-of(tqCompanyByDomain.tcCompanyCode)
        then assign vcCompanyList = vcCompanyList                   +
                                    tqCompanyByDomain.tcCompanyCode +
                                    "   ("                          +
                                    tqCompanyByDomain.tcDomainCode  +
                                    ")" + chr(2)                    +
                                    tqCompanyByDomain.tcCompanyCode +
                                    chr(2).
    end.
    assign vcCompanyList = trim(vcCompanyList,chr(2)).

    create tBusinessFields.
    assign tBusinessFields.tcSideLabel        = trim(#T-10'Company Code':20(65359)T-10#)
           tBusinessFields.tcFcDescription    = trim(#T-48'Company Code':20(65359)T-48#)
           tBusinessFields.tcFcFieldName      = "Company_CANDO"
           tBusinessFields.tcValueList        =  vcCompanyList
           tBusinessFields.tcValidationMask   = "IsEntityCode"
           tBusinessFields.tcDataType         = "c"
           tBusinessFields.tcControlType      = "ComboBox"
           tBusinessFields.tcDisplayFormat    = "x(20)"
           tBusinessFields.tcFcFieldType      = "F".
end.       


if can-do("VoucherCompleteness":U, icReference)    
then do:
    create tBusinessFields.
    assign tBusinessFields.tcSideLabel     = #T-5'Daybook Code':30(1025)T-5#
           tBusinessFields.tcFcDescription = #T-6'A List of Daybook Codes':100(14795)T-6#
           tBusinessFields.tcFcFieldName   = "JournalCode_CANDO":U
           tBusinessFields.tcDataType      = "c":U
           tBusinessFields.tcControlType   = "TextBox":U
           tBusinessFields.tcDisplayFormat = "x(20)":U
           tBusinessFields.tcFcFieldType   = "F":U
           tBusinessFields.tcLookupQuery       = "BJournalSAO.SelectJournal":U
           tBusinessFields.tcLookupReturnField = "tqSelectJournal.tcJournalCode":U
           tBusinessFields.tcLookupFilterField = "tJournal.JournalCode":U.
    create tBusinessFields.
    assign tBusinessFields.tcSideLabel     = trim(#T-13'GL Cal Year':30(1274)T-13#)
           tBusinessFields.tcFcDescription = trim(#T-14'GL Cal Year':100(1275)T-14#)
           tBusinessFields.tcFcFieldName   = "PeriodYear":U
           tBusinessFields.tcDataType      = "i":U
           tBusinessFields.tcControlType   = "NumericInt":U
           tBusinessFields.tcDisplayFormat = "9999":U
           tBusinessFields.tcFcFieldType   = "F":U.
    create tBusinessFields.
    assign tBusinessFields.tcSideLabel     = trim(#T-15'GL Period':30(1276)T-15#)
           tBusinessFields.tcFcDescription = trim(#T-16'GL Period':100(1277)T-16#)
           tBusinessFields.tcFcFieldName   = "PeriodPeriod_RANGE":U
           tBusinessFields.tcDataType      = "i":U
           tBusinessFields.tcControlType   = "NumericInt":U
           tBusinessFields.tcDisplayFormat = "99":U
           tBusinessFields.tcFcFieldType   = "F":U.       
end.

if can-do("FAControlGLBalance":U, icReference)
then do:
    create tBusinessFields.
    assign tBusinessFields.tcSideLabel     = #T-11'Show Disposal and revaluation':30(17423)T-11#
           tBusinessFields.tcFcDescription = #T-12'Show Disposal and revaluation':30(17423)T-12#
           tBusinessFields.tcFcFieldName   = "NotLinked":U
           tBusinessFields.tcDataType      = "l":U
           tBusinessFields.tcControlType   = "Bool":U
           tBusinessFields.tcDisplayFormat = "yes/no":U
           tBusinessFields.tcFcFieldType   = "F":U.
end.

if can-do("HistoryPostingsCheck":U, icReference)
then do:
   create tBusinessFields.
   assign tBusinessFields.tcSideLabel     = #T-17'Check that transaction history is up to date.':40(14718)t-17#
          tBusinessFields.tcFcDescription = #T-18'Check if History Is Up To Date':50(14723)T-18#         
          tBusinessFields.tcFcFieldName   = "CheckHistory":U
          tBusinessFields.tcDataType      = "l":U
          tBusinessFields.tcControlType   = "Bool":U
          tBusinessFields.tcDisplayFormat = "yes/no":U
          tBusinessFields.tcFcFieldType   = "F":U.  
end.

if can-do("AccUnmarkedTransactions":U, icReference)
then do:
   create tBusinessFields.
   assign tBusinessFields.tcSideLabel     = #T-19'Sort By':40(57481)T-19#
          tBusinessFields.tcFcDescription = #T-20'Sorting by Daybook or Voucher':255(57483)T-20#         
          tBusinessFields.tcValueList     = {&CL-SORTBY-DAYBOOK} + chr(2) + {&CL-SORTBY-DAYBOOK-TR} + 
                                             chr(2) + {&CL-SORTBY-VOUCHER} + chr(2) + {&CL-SORTBY-VOUCHER-TR}
         tBusinessFields.tcFcFieldName   = "SortBy":U
          tBusinessFields.tcDataType      = "c":U
          tBusinessFields.tcControlType   = "ComboBox":U
          tBusinessFields.tcDisplayFormat = "x(20)":U
          tBusinessFields.tcFcFieldType   = "F":U.  
end.

if can-do("TransientLayers":U, icReference)
then do:
   create tBusinessFields.
   assign tBusinessFields.tcSideLabel     = #T-23'Sort By':40(57481)T-23#
          tBusinessFields.tcFcDescription = #T-24'Sorting by Layer or Daybook or Voucher':255(57544)T-24#         
          tBusinessFields.tcValueList     = {&CL-SORTBY-LAYER} + chr(2) + {&CL-SORTBY-LAYER-TR} + chr(2) +
                                            {&CL-SORTBY-DAYBOOK} + chr(2) + {&CL-SORTBY-DAYBOOK-TR} + 
                                             chr(2) + {&CL-SORTBY-VOUCHER} + chr(2) + {&CL-SORTBY-VOUCHER-TR}
         tBusinessFields.tcFcFieldName   = "SortBy1":U
          tBusinessFields.tcDataType      = "c":U
          tBusinessFields.tcControlType   = "ComboBox":U
          tBusinessFields.tcDisplayFormat = "x(20)":U
          tBusinessFields.tcFcFieldType   = "F":U.  
end.


if can-do("Recurring Entries":U, icReference)
then do:
   create tBusinessFields.
   assign tBusinessFields.tcSideLabel     = #T-21'Sort By':40(57481)T-21#
          tBusinessFields.tcFcDescription = #T-22'Sorting by Recurring Entry Code or Posting Date':255(57489)T-22#         
          tBusinessFields.tcValueList     = {&CL-SORTBY-RECURRINGENTRYCODE} + chr(2) + {&CL-SORTBY-RECURRINGENTRYCODE-TR} + 
                                             chr(2) + {&CL-SORTBY-POSTINGDATE} + chr(2) + {&CL-SORTBY-POSTINGDATE-TR}
         tBusinessFields.tcFcFieldName   = "SortBy2":U
          tBusinessFields.tcDataType      = "c":U
          tBusinessFields.tcControlType   = "ComboBox":U
          tBusinessFields.tcDisplayFormat = "x(20)":U
          tBusinessFields.tcFcFieldType   = "F":U.  
end.


Sample code: how to call this method 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 = "BClosingPostingsReport".
create ttContext.
assign ttContext.propertyName = "methodName"
       ttContext.propertyValue = "GetBusinessFields".
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 = "".

/* 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.