Hello,
On an extension of Form I have added a Real type control to the form, where I want to assign the number of currently selected lines from grid.
I have created a class and copied the "OnActivated" event of the main datasource. There I have placed the below code:
[FormDataSourceEventHandler(formDataSourceStr(ReqTransPo, ReqPo), FormDataSourceEventType::Activated)]
public static void ReqPo_OnActivated(FormDataSource sender, FormDataSourceEventArgs e)
{
FormRun formRun = sender.formRun() as FormRun;
FormRealControl numOfLinesControl = formRun.design().controlName(formControlStr(ReqTransPo, NumOfLinesXX)) as FormRealControl;
numOfLinesControl.realValue(sender.recordsMarked().lastIndex());
}
When I open the form it gives the error message "Object reference not set to an instance of an object."
What do I need to change?