Purpose:
The purpose of this document is to show how to get multiple selected records in form control event handlers.
Development:
First of all create new
event handler class HRPayrollPayStatementEventHandler and subscribe to form button OnClicked event handler.
/// <summary>
/// The
<c>HRPayrollPayStatementEventHandler</c> class is the event
handler class for managing PayrollPayStatement form events
/// </summary>
class HRPayrollPayStatementEventHandler
{
///
<summary>
///
Click event handler
///
</summary>
///
<param name="_sender">Form control buffer</param>
///
<param name="_e"> Event args</param>
[FormControlEventHandler(formControlStr(PayrollPayStatement, CustomButton),
FormControlEventType::Clicked)]
public static void
SLD_CustomButton_OnClicked(FormControl _sender, FormControlEventArgs _e)
{
FormDataSource PayrollPayStatement_DS =
_sender.formRun().dataSource(formDataSourceStr(PayrollPayStatement,
PayrollPayStatement));
MultiSelectionHelper selectionHelper = MultiSelectionHelper::construct();
PayrollPayStatement payStatement;
selectionHelper.parmDataSource(PayrollPayStatement_DS);
payStatement =
selectionHelper.getFirst();
if (payStatement.RecId)
{
while (payStatement.RecId != 0)
{
info
(payStatement.DocumentNumber);
payStatement =
selectionHelper.getNext();
}
}
}
}
No comments:
Post a Comment