Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

Running method class in batch

(0) ShareShare
ReportReport
Posted on by 910

Hello,

Please i have a technical blockage and I need your help and suggestion.

When we generate vendor payment(SEPA CREDIT TRANSFER), we want to save in a folder and send by mail the payment notice.

=> This works fine in client mode.

Sometimes we have long payment journals and it take many times so the user is blocked and waits for the end of the process

=> Here we want to run the method behind the ok button on batch server

To do that i started to create a class run batch and put the OK method in the run of this class.

When i run the credit transfer on batch, i get this error : 

8233.Capturee.JPG

Please do you have any idea how can i run the credit transfer in batch

Update 2 : 

After running FULL CIL the first error is fixed, here i get another one 

=> I did not get this error when i run on client mode only in batch

8484.Capture3.JPG

Many thinks in advance

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    Gunjan Bhattachayya 35,421 on at
    RE: Running method class in batch

    Hi Alex,

    You can use code from this post to save the report as pdf to a folder.

  • ALAhmed Profile Picture
    ALAhmed 910 on at
    RE: Running method class in batch

    Hi Gunjan,

    Non i save it as PDF in a folder

  • Gunjan Bhattachayya Profile Picture
    Gunjan Bhattachayya 35,421 on at
    RE: Running method class in batch

    Hi Alex,

    Where are you trying to print the report? Since it's a batch process, it won't print on the screen. Are you sending the report to print management?

  • ALAhmed Profile Picture
    ALAhmed 910 on at
    RE: Running method class in batch

    thank you Gunjan  for your remark.

    finally i understand the meaning of the error.   We cannot call menu Item from server so i change method that calling report from MenFunction class to :

    I change this 
    
    menuFunction = new MenuFunction(_menuItemstr, MenuItemType::Output);
    menuFunction.run(args);
    
    By 
    
    Args                                args;
    SRSPrintDestinationSettings         settings;
    SrsReportRunController              controller  = new SrsReportRunController();
    VendOutCoveringLetterContract_SEPA  rdpContract = new VendOutCoveringLetterContract_SEPA();
    
    // Define report and report design to use
    controller.parmReportName(ssrsReportStr(VendOutCoveringLetter_SEPA, Report));
    controller.parmExecutionMode(SysOperationExecutionMode::Synchronous);
    controller.parmShowDialog(false);// Suppress report dialog
    ....
    // Execute the report
    controller.startOperation();

    Thanks

  • Gunjan Bhattachayya Profile Picture
    Gunjan Bhattachayya 35,421 on at
    RE: Running method class in batch

    Hi Alex,

    You are trying to print a report in batch mode, which is not possible. That's why you didn't get the error while running from the client.

    You can put a condition for running this report when running on client only and that should take care of the error.

  • nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Running method class in batch

    Could you please change the system language to English so that we can see the error messages in English?

  • ALAhmed Profile Picture
    ALAhmed 910 on at
    RE: Running method class in batch

    HI Martin,

    Please see my update 2

    regards

  • Martin Dráb Profile Picture
    Martin Dráb 230,354 Most Valuable Professional on at
    RE: Running method class in batch

    I think it just says that ErrorException was thrown and where, but it doesn't contain any details.

    I would either look at the code in question or look at exception details in debugger.

  • Gunjan Bhattachayya Profile Picture
    Gunjan Bhattachayya 35,421 on at
    RE: Running method class in batch

    Hi Alex,

    Could you please translate the error into English as well?

  • ALAhmed Profile Picture
    ALAhmed 910 on at
    RE: Running method class in batch

    Hi GunJan,  

    I added the code, please see my update

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,622 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,354 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans