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

Announcements

News and Announcements icon
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 204
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);
}
I have the same question (0)
  • Verified answer
    GirishS Profile Picture
    27,843 Moderator on at
    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.
  • RSX Profile Picture
    204 on at
    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.
  • GirishS Profile Picture
    27,843 Moderator on at
    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.
  • Suggested answer
    Mohit Rampal Profile Picture
    12,573 Moderator on at
    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.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288 Super User 2026 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 270 Most Valuable Professional

#3
Anton Venter Profile Picture

Anton Venter 217 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans