Hi guys,
This blog will be useful in those scenarios where in standard MS Form datasource methods (init, write, validateWrite, active, selectionChanged etc) will be required to further extend the standard functionality.
Requirement:
I came across a requirement on which I had to disable the standard MS field on the basis of a true value on custom boolean field. If custom flag field contains true value then target field "Allow reservation" on the return sales order line should be disabled as a result of focus set on that selected return sales order line.
Solution:
Right click on the Form datasource active method and then click create an extension to create an extension class.
[ExtensionOf(formDataSourceStr(ReturnTable, SalesLine))]
final class DemoReturnTableSalesLineFrm_Extension
{
int active()
{
int ret = next active();
SalesLine salesLine = this.cursor();
SalesTable salesTable = SalesTable::find(salesLine.SalesId);
FormRun formRun = this.formRun();
if(salesTable.DemoPriceAdjustment)
{
formRun.control(formRun.controlId(formControlStr(ReturnTable, return_ReturnAllowReservation))).enabled(false);
}
return ret;
}
}

Like
Report
*This post is locked for comments