cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

FormCalc: hide body row from table when several records exist

jepi_flanders
Participant
0 Kudos
268

Hi Experts,

I've a Subform with a Cell-Table containing three rows.

Each row contains a Text-Field, bound to a data structure field.

The data structure contains several records.

I need to hide the Row3 if the content in the relevant data structure field is empty. For that, I've added the following FormCalc code for the Initialize event:

  data.Tables.TAB_MAIN.LINES.orders.orders_lines.ITEMS_TAB.ITEM_LINE.LOT.LOT.Row3::initialize - (FormCalc, client)
if ($record.PACKINGLIST.DATA.GROUP.DATA[*].LOT_FATHER == null or $record.PACKINGLIST.DATA.GROUP.DATA[*].LOT_FATHER == "") then
$.presence	= "hidden"
else
$.presence	= "visible"
endif

The problem I've is that, if the first data structure record field bound to Row3 is empty, then the row is hidden (and that's Okay), but then the next record field not empty will not turn the row as visible.

That is to say, Row3 remains hidden for all records.

Could it be that the Initialize event is not the appropriate one for my need?

If so, what could be the right event?

Or, is there any other problem with my code/implementation?

Thank you so much for any help on this

JF

Accepted Solutions (0)

Answers (0)