Skip to main content

Notifications

Community site session details

Community site session details

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

Inserting Grid's multi line data into another dialog form.

(0) ShareShare
ReportReport
Posted on by 202
Hi,
I have created a dialog form /MultiPrint/ with a grid and have added the form to Menubutton /Multiselect/ in /salesTable/ form's action pane. 
Requirement is,  from the SalesLine grid the selected multilines, should be captured in my dialog form. 

I have written in my /MultiPrint/ form datasource init method as follows: But only one line is getting captured in dialog form. Is there any other approach?
.
public void init()
{
MultiPrintTableMultilineTable;
SalesLine     lsalesLine;
MultiSelectionHelper    helper = MultiSelectionHelper::construct();        
super();
FormDataSource multiLine = element.args().record().datasource();      
helper.parmDatasource(multiLine);            
lsalesLine = helper.getFirst();            
while(lsalesLine.RecId != 0)            
{            
MultilineTable.UnitOfMeasure = lsalesLine.SalesUnit;                    
MultilineTable.CustAccount = lsalesLine.CustAccount;                        
MultilineTable.insert();                            
lsalesLine = helper.getNext();
}
MultiPrintTable.linkPhysicalTableInstance(MultilineTable);
}
  • Suggested answer
    Mohit Rampal Profile Picture
    12,563 Moderator on at
    Inserting Grid's multi line data into another dialog form.
    Hi, Can you share code written on clicked method of button in salesTable form. You can try looping SalesLine RecIds and sending in container as specified in the article shared before. In init method of your form, loop all RecIds, find SalesLine table buffer and insert record in your custom table.
  • GirishS Profile Picture
    27,825 Moderator on at
    Inserting Grid's multi line data into another dialog form.
    Have you debugged the code? 
    What is the value of string control while passing it to parmArgs method?
    Also, on the init method of the dialog form does the container loops?
     
    Thanks,
    Girish S.
  • RSX Profile Picture
    202 on at
    Inserting Grid's multi line data into another dialog form.
    Hi Girish,
    I tried the same as per the blog.

    Still it is capturing only the last record that we select. Ex: if i select Line1,2,3 and click on the button, only the line 3 is being captured in the new form.
  • Verified answer
    GirishS Profile Picture
    27,825 Moderator on at
    Inserting Grid's multi line data into another dialog form.
    Hi RSX,
     
    Refer to the below blog. You can override the clicked method of Multiselect button control.
    Inside the clicked method get the selected line from the grid - Insert into container and then convert the container to string separating each value by comma.
    You can then call the dialog form inside the clicked method along with string values inside the parm method.
    Refer to the below blog.
     
    Thanks,
    Girish S.

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

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

#1
Martin Dráb Profile Picture

Martin Dráb 601 Most Valuable Professional

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 416

#3
Adis Profile Picture

Adis 384 Super User 2025 Season 1

Product updates

Dynamics 365 release plans