project QadFinancials > class TReportSwitchMenu > method GetCurrRptMenuSettings


Parameters


tRptMenuSettingsDS2input-outputtemp-table
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method TReportSwitchMenu.MainMethod


program code (program1/treportswitchmenu.p)

/* ================================================================================================ */
/* This program will get all the methods which can be run as CR or as C1 report                     */
/* The method must exist as Resource (rptdes_mstr)                                                  */
/* The method must be existon the menu (mnd_det)                                                    */
/* ================================================================================================ */
empty temp-table tRptMenuSettingsDS2.

/* ================================================================================================ */
/* Get the List of all the report methods which can run using C1. This is a hard-coded list         */
/* ================================================================================================ */
<M-88 run CreateRptList  (output viFcReturnSuper (oiReturnStatus)) in TReportSwitchMenu>

/* ========================================================================================================= */
/* Check if there exist exists a correspodning definition in the QRF resource table (rptres_mstr)            */
/* If not we can skip this method                                                                            */
/* If it is found the new URI is returned - starting with urn:qad-report:c1:                                 */
/* we search on QAD_<ClassName>_<MethodName> and QAD_<MethodName>                                            */
/* ========================================================================================================= */
for each tRptList:

    create tRptMenuSettingsDS2.
    assign tRptMenuSettingsDS2.tcRptOldUri = "urn:cbf:" + tRptList.tcName
           tRptMenuSettingsDS2.tlNotFound  = no
           tRptMenuSettingsDS2.tlIsChanged = no.
     
    /* Check if this exist in rptdes_mstr */
    <M-95 run GetCurrRptMenuSettingsRES
       (input  tRptList.tcName (icMethodName), 
        output tRptMenuSettingsDS2.tcRptNewUri (ocRptNewUri), 
        output viFcReturnSuper (oiReturnStatus)) in TReportSwitchMenu>

     /* If not found we can ignore */
     if tRptMenuSettingsDS2.tcRptNewUri = ''
     then delete tRptMenuSettingsDS2.

end. /* for each tRptList */

/* ========================================================================================================= */
/* Check the Menu to see which URI is used in the Menu now                                                   */
/* If cbf we allow the user to set it to the new (QRF) one                                                   */
/* If QRF we allow the user to reset it to the old (cbf) one                                                 */
/* ========================================================================================================= */
for each tRptMenuSettingsDS2:
    
    <M-96 run GetCurrRptMenuSettingsMENU
       (input  tRptMenuSettingsDS2.tcRptNewUri (icRptNewUri), 
        input  tRptMenuSettingsDS2.tcRptOldUri (icRptOldUri), 
        output vlFoundInMenu (olFoundInMenu), 
        output tRptMenuSettingsDS2.tlIsUseQRF (olIsUseQRF), 
        output tRptMenuSettingsDS2.tcRptNumber (ocRptNumber), 
        output tRptMenuSettingsDS2.tcRptDesc (ocRptDesc), 
        output viFcReturnSuper (oiReturnStatus)) in TReportSwitchMenu>

     if not vlFoundInMenu
     then delete tRptMenuSettingsDS2.
        
end. /* for each tRptMenuSettingsDS2: */