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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Is it possible to pass multiple line table buffer from one form to another form

(0) ShareShare
ReportReport
Posted on by

In planned purchase order details form, ie reached through Account payable>common forms>planned purchase order. the selected item number (datasource = reqpo table)should be passed to another form while clicking the button functions>firm. What i want to know is how will you pass the whole table buffer(with selected lines only)to another form using args class in ax2009.

thanks in advance

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Check this Topic, it's the same issue: community.dynamics.com/.../165619

    Using args would be the best way. Either you pass the data source/buffer and then get all the selected records with the MultiSelectionHelper class in the second form or you collect the records before calling the second form and save them in a set/container/... and pass this set/container with args to the second form.

    Ax will automatically create args and pass it to a second form if you use a menuitem button and set the data source correctly. In your second form you can then access the args with element.args(), so element.args().record() will give you the buffer with the selected records.

  • Community Member Profile Picture
    on at

    HI Thaku,

          You can use args.record to pass data from one form to another, for multiple records MultiSelectionHelper class is helpful and make sure that Button property MultiSelect is Yes.

    Example:

    void clicked()

    {

       StudTable StudTable;

       MultiSelectionHelper helper = MultiSelectionHelper::construct();

       helper.parmDatasource(StudTable_1_ds);

       StudTable = helper.getFirst();

       while (StudTable.RecId != 0)

       {

           info(StudTable.Name);

           StudTable = helper.getNext();

       }

       super();

    }

    Thank you..

  • Community Member Profile Picture
    on at

    Hi Jens,

    Thanks, i will look up on it.

  • Community Member Profile Picture
    on at

    Hi Thameem Tharick,

    thanks for the reply , but how will you get the datasource in the init method of  another form. element.args().parm and element.args().parmobject() i already used.

    thanks,

    thaku

  • Community Member Profile Picture
    on at

    The buffer holds the data source.

    First form

    args.record(inventTable);

    (this should be done automatically when using a menuitem button)

    Second form:

    InventTable   inventTable;

    FormDataSource fds;

    inventtable = element.args().record();

    fds = inventTable.datasource();

  • Community Member Profile Picture
    on at

    Hi jens,

    I am not using a menuitem in clicked method, radically i am calling my form in clicked method. By the following code

    void clicked()

    {

    ;

       args.name(formstr(myformName));

         args.parm(str);// passed the parameters as string

         args.record(reqpo);// i am not getting any buffer.(while debugging it shows recid=0)

       args.parmObject(conclass_obj); passed the containers values

       formrun = ClassFactory.formRunClass(args);

       formrun.init();

       formrun.run();

       formrun.wait();

    }

  • Community Member Profile Picture
    on at

    HI jens ,

    i selected three lines while clicking the button.

    thanks,

    thaku

  • Community Member Profile Picture
    on at

    There has to be a record when you selected a planned order. I think reqTrans is the main table of the form. Is it possible that there is no reqPO for the reqTrans you selected? Please check in the debugger if a reqTrans is present.

    You still have to use the MultiSelectionHelper in the second form to get more than one record.

    ReqPO reqPO;
    
    FormDataSource fds;
    
    MultiSelectionHelper helper = MultiSelectionHelper::construct();
    
    reqPO = element.args().record();
    
    fds = reqPO.datasource();
    
    helper.parmDatasource(fds );
    
    reqPO= helper.getFirst();
    
    while (reqPO.RecId != 0)
    
    {
    
       //your code
    
       reqPO= helper.getNext();
    
    }
    

  • Community Member Profile Picture
    on at

    Hi Jens & Thameem Tharick,

    thankzz guys it was very helpful indeed. thank you so much

    regards

    thaku

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans