project QadFinancials > class TReportSwitchMenu > method GetCurrRptMenuSettingsMENU


Parameters


icRptNewUriinputcharacter
icRptOldUriinputcharacter
olFoundInMenuoutputlogical
olIsUseQRFoutputlogical
ocRptNumberoutputcharacter
ocRptDescoutputcharacter
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method TReportSwitchMenu.GetCurrRptMenuSettings


program code (program1/treportswitchmenu.p)

define variable vhMnd_det as handle no-undo.
define variable qhMnd_det as handle no-undo.
create query qhMnd_det in widget-pool "non-persistent".
create buffer vhMnd_det for table "mnd_det" in widget-pool "non-persistent".
qhMnd_det:set-buffers(vhMnd_det).

qhMnd_det:query-prepare("for each mnd_det where mnd_det.mnd_uri = "  + quoter(icRptNewUri) + " no-lock" ).
qhMnd_det:query-open.
qhMnd_det:get-first().	

if not qhMnd_det:query-off-end    
then do:
    /* The QRF URI is being used on the menu */
    assign olIsUseQRF    = yes
           olFoundInMenu = yes
           ocRptDesc     = vhMnd_det::mnd_label
           ocRptNumber   = vhMnd_det::mnd_nbr + "." + trim(string(vhMnd_det::mnd_select,">9")).
    qhMnd_det:query-close.
end.
else do:
    qhMnd_det:query-close.

    qhMnd_det:query-prepare("for each mnd_det where mnd_det.mnd_uri = "  + quoter(icRptOldUri) + " no-lock" ).
    qhMnd_det:query-open.
    qhMnd_det:get-first().

    if not qhMnd_det:query-off-end   
    then do:
       /* The QRF URI is not used on the Menu while the CBF URI is used */
       assign olIsUseQRF    = no
              olFoundInMenu = yes
              ocRptDesc     = vhMnd_det::mnd_label
              ocRptNumber   = vhMnd_det::mnd_nbr + "." + trim(string(vhMnd_det::mnd_select,">9")).
    end.
    else do:
        /* Not on the menu at all */
        assign olFoundInMenu = no.
    end.       
    
    qhMnd_det:query-close.
end. /* else do */

delete object  qhMnd_det no-error.
assign qhMnd_det = ?. 
delete object vhMnd_det no-error.