Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / How to get selected re...
Finance forum

How to get selected records of listpage on button click method in d365 finance & operations

(0) ShareShare
ReportReport
Posted on by 410

Hello All,

I have added button in production order listpage and on button click i have to update few data on all production order selected in listpage. But I am getting error when I am trying to retrieve datasource of listpage "ProdTable_ds".

class CreateProductionGroupId
{

/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
[FormControlEventHandler(formControlStr(ProdTableListPage, SAB_ProductionOrder), FormControlEventType::Clicked)]
public static void GroupProductionOrder_OnClicked(FormControl sender, FormControlEventArgs e)
{
ProdTable prodTable,prodTable1;
NumberSeq numberSeq;
SAB_ProdGroupId num;
int flag;
;

for(prodTable=getFirstSelection(ProdTable_ds); prodTable;prodTable=ProdTable_ds.getNext())
{
if(flag==0)
{
numberSeq = NumberSeq::newGetNum(ProdParameters::numRefGOD_ProdGroupId());
num = numberSeq.num();
}
prodTable1 = prodtable::find(prodTable.ProdId);
if(prodTable1)
{
ttsbegin;
prodtable1.GOD_ProdGroupId = num;
ttscommit;
}

flag++;
}
flag=0;
}

}

Please Help

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans
Liquid error: parsing "/forums/thread/details/?threadid=%27nvOpzp;%20AND%201=1%20OR%20(%3C%27%22%3EiKO))," - Too many )'s.