Skip to main content

Notifications

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

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,228 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,056 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans