Using the form DataSource (ie. The DataSources which are in Form DataSource level can be accessed through DataSourceName_ds from any where in the Custom form ) this will return the current cursor where the record is active in the Grid, To assign the current Cursor to the table buffer use
TableName buffer = DataSourceName.cursor();
Using the below way we can use the allow edit of the
particular record that is active in cursor.
SalesLine_ds.object(fieldNum(SalesLine, lineno)).allowEdit(true);
SalesLine_ds.object(fieldNum(SalesLine, lineno)).allowEdit(false);
SalesLine_ds.object(fieldNum(SalesLine, lineno)).enabled(true);
SalesLine_ds.object(fieldNum(SalesLine, lineno)).enabled(false);