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 :
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,827 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,827 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,565 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

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 611 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans