How to access field in Datagroup without changing its AutoDatagroup property

Hi

In onHand form i need to show warning when Batch number field is not displayed in grid when I click a button

How is the title related to your actual question?

I assume you should check whether the datasource field is set to visible or not; it doesn’t seem to have anything to do with AutoDatagroup property.

I want to access Inventbatchid field in Inventorydimensionsgrid, i want to check whether batchnumber is displayed in grid or not

Then you seems to agree that the title is wrong, therefore please fix it.

The get a reference to a datasource field, you can use something like this:

inventDim_ds.object(fieldNum(InventDim, InventBatchId))

And to check whether the field is visible or not, call its visible() method.