Hi all,
Is there a way to list security rights for all users across all companies
(without running the user permissions report for each combination)? I am
trying to achieve this with a job, but I dont want the prompt to appear for
each case, so I'm doing the following:

static void AllUserSecurityReport(Args _args)
{
    SysUserSecurityReport   sysUserSecurityReport;
    SysUserInfo             userInfo;
    PrintJobSettings        printSettings = new PrintJobSettings();
    SysSecurity             sysSecurity;
    DataArea                dataArea;

;
    //Set up our print settings (print the data to the print archive)
    printSettings.setTarget(PrintMedium::PrintArchive);
    printSettings.preferredTarget(PrintMedium::PrintArchive);
    printSettings.format(PrintFormat::PDF);
    printSettings.preferredFileFormat(PrintFormat::PDF);

    //Run through all users
    while select userInfo
    {
        while select dataArea
        {
            sysUserSecurityReport = new SysUserSecurityReport();
            sysUserSecurityReport.getLast();

            sysUserSecurityReport.initParmDefault();
            sysUserSecurityReport.parmUserId(userInfo.Id);
            sysUserSecurityReport.parmDataAreaId(dataArea.id);

            sysUserSecurityReport.init();

            //if(sysUserSecurityReport.prompt())
            {
                sysUserSecurityReport.initPrinterSettings(printSettings);
                sysUserSecurityReport.run();
            }
        }
    }
}

This reports the following exception:
Error executing code: RunBaseDialogModify object not initialised.
Stack trace:
(C) \Classes\RunBaseDialogModify\initPrinterSettings
(C) \Classes\RunBaseReport\initPrinterSettings - line 3
(C) \Jobs\AllUserSecurityReport - line 35

If I omit the call to initPrinterSettings, the exception just gets thrown in
sysUserSecurityReport.run. Am I going about this totally wrong, and is there
already a way to do this?

Regards,

Matt Benic
Axapta Developer
UTi Sun Couriers Division



Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to