Announcements
[ExtensionOf(formStr(SalesCopying))]
final class SalesCopying_Extension
{
void init()
{
next init();
}
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
[FormControlEventHandler(formControlStr(SalesCopying, OK), FormControlEventType::Clicked)]
public void OK_OnClicked(FormControl sender, FormControlEventArgs e)
{
SalesId sid=salesTable.SalesId;
FormRun formRun = sender.formRun() as FormRun;
FormDataSource formDataSource;
Common common;
formDataSource = formRun.dataSource(formDataSourceStr(SalesCopying, SalesTable));
common = formDataSource.cursor();
if (common)
{
str headerField1 = common.(fieldNum(SalesTable, SalesId));
info(strFmt("Selected header: %1", headerField1));
}
}
}
Hi Martin, thank you. I followed the suggested solution, but I'm still having trouble retrieving the selected sales order from the grid. Could you please assist me with this? I was able to update a record successfully.
public void copy()
{
next copy();
str refId = SalesLine::find(salesTable.SalesId).InventTransIdReturn;
str salesId = InventTransOrigin::findByInventTransId(refId).ReferenceId;
salesTable.WorkerSalesResponsible=5637147530; //Need to set from the ref transaction
this.updateHeader();
info(strFmt("Ref Sales order Id: %1", this.salesTable.WorkerSalesResponsible));
info(strFmt("Sales order Id: %1", salesId));
}
André Arnaud de Cal...
294,095
Super User 2025 Season 1
Martin Dráb
232,866
Most Valuable Professional
nmaenpaa
101,158
Moderator