Hello
I am using D365fo. I have a display method on a form data source through extension and used the method on a grid which has fields from two different data sources. My display shows data correctly, but the problem is when a row is highlighted, the value from currently highlighted row on display method field updates the value of all the rows on display method field on the grid.
Here is my method
public display customfield Number(ReqTransCov _reqTransCov)
{
FormDataSource ReqTransSettledDS = this.formRun().dataSource("ReqTransSettled");
ReqTrans reqTransSettled = ReqTransSettledDS.cursor();
xxxProductAttributes ProductAttibute;
if (reqTransSettled.RefType == ReqRefType::ProdLine)
{
ItemId itemId = ProdTable::find(reqTransSettled.RefId).ItemId;
select firstonly ProductAttibute
where ProductAttibute.Product == InventTable::find(ProdTable::find(reqTransSettled.RefId).ItemId).Product;
}
else if (reqTransSettled.RefType == ReqRefType::Sales)
{
select firstonly ProductAttibute
where ProductAttibute.Product == InventTable::find (_reqTransCov.ItemId).Product;
}
return ProductAttibute.Num;
}
Thanks