web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to build a batch processing with "Records to include" option?

(0) ShareShare
ReportReport
Posted on by 6,470

Hello,

I'm building a process to post some journals through batch processing (sysoperationframewrk).

I can't see how can I include "Records to include" option.

I want to have it for WMSJournalTable table.

Do we do it in Contract class? 

I have the same question (0)
  • Verified answer
    Sergei Minozhenko Profile Picture
    23,093 on at
    RE: How to build a batch processing with "Records to include" option?

    Hi,

    As it was mentioned already you can get a contract in the controller via getDataContractObject, apply ranges to query, and set query back to contract and it should be done before startOperation method. 

    Note, that getDataContractObject requires the name of the contract as a parameter and it's parameter name of contract from service method.

    protected void initContract(Args _args)
    {
        MyContract   contract;
        Query        q;
        ;
        contract = this.getDataContractObject('_contract'); //Note that it's name of contract variable in service method
    
        q = contract.getQuert();
        
        MultiSelectionHelper multiSelectionHelper;
    
        multiSelectionHelper = MultiSelectionHelper::createFromCaller(_args.caller());
        multiSelectionHelper.createQueryRanges(q.dataSourceTable(tableNum(MyTable)), fieldStr(MyTable, JournalId));
        
        qbr = findOrCreateRange_W(q.dataSourceTable(tableNum(MyTable)), fieldNum(MyTable, JournalId));
    
        contract.setQuery(q);
    }

  • Verified answer
    Mariano Gracia Profile Picture
    on at
    RE: How to build a batch processing with "Records to include" option?

    In the controller's main method you will need to catch your datasource caller from the args parameters, once you have the datasource, you can use the MultiSelectionHelper object to capture the records selected and modify the contract's query, you can do it because the controller can returns the contract object using the method getDataContractObject

  • Johnny Profile Picture
    6,470 on at
    RE: How to build a batch processing with "Records to include" option?

    Hi Sergei,

    sorry, I had wrong attribute for the parm method. Now I can see the "Records to include".

    One more question:

    If I have the Action menu item which calls my controller / service / contract classes on the Journal form and I have selected multiple Journals. Is it possible that these selected Journals go to "Records to include" query when I click on the action menu item button?

    For example I have Journal1, Journal2, Journal3 selected from Item Arrival. I click this new button (which allows multiple selection) and I want the "Records to include" to be filtered by Journal1, Journal2, Journal3 automatically.

  • Sergei Minozhenko Profile Picture
    23,093 on at
    RE: How to build a batch processing with "Records to include" option?

    Hi Johnny,

    Could you, please, share your contract and service method signature? Have you tried to reset usage data for user also?

  • Johnny Profile Picture
    6,470 on at
    RE: How to build a batch processing with "Records to include" option?

    Hi Sergei,

    I created a AOT Query of WMSJournalTable and did the steps connected to AifQueryTypeAttribute parm method. Still, when I run menu item, I do not see Records to include tab

  • Verified answer
    Sergei Minozhenko Profile Picture
    23,093 on at
    RE: How to build a batch processing with "Records to include" option?

    Hi Johnny,

    Yes, it's done in Contract class via DataMember and AifQueryTypeAttribute attribute.

    www.artofcreation.be/.../

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,206

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 847 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 596 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans