App Studio - Check dataview condition empty

I am calling a service method to fill dataview but in certain criteria, it is getting empty results. As I bind this dataview to a grid, my grid is getting disabled.

So, I need to put a condition to check whether dataview is empty or not. If yes, I need to initialize the dataview to make the grid active.

Any idea how to achieve this?

You can add an empty row but that probably won’t be good. What does the grid getting disabled do to you if there’s no data in the grid?

I have a “+” (Plus) button in my grid, which is added as an extended property. This grid is located within the Sales Order Line Details section. When the user changes the line, my custom event fetches existing records from UD03 and populates the grid.

In some scenarios, there may be no matching records, resulting in an empty dataset. In such cases, I want the grid to remain enabled so the user can add a new record. However, the grid is currently disabled when the bound DataView is empty.

I got answer for this.
To check dataview empty in condition,

  1. %dataview.hasRow% - this returns true when empty
  2. %dataview.count% == 0 - this also can be used

I’ve got a similar scenario. So, how did you keep the grid active?

Remove epi binding from Properties and keep it inside Grid Model.