I wrote a very handy macro for Base that copies an array of fields from one form to another. It works no matter if the form is at the highest level, a sub form, or a sub-sub form, etc. However, it completely fails when I try to access forms represented by a table control (as opposed to separate fields). Some people call table controls “grid controls” where there are rows and columns of data representing your records.
Is there a special method or object I must use to access data displayed in a table control that differs from separate form fields?
As a quick example, normally to read the value from a field I do something like this:
thisComponent.drawpage.forms.getByName("form").getByName("subForm").getByName("subSubForm").getByName("fieldName").getCurrentValue()
And to write to the same field I would do something like:
thisComponent.drawpage.forms.getByName("form").getByName("subForm").getByName("subSubForm").getByName("fieldName").boundField.updateString("some value")
This always works for regular, separate fields. If, however, there is a table control (aka grid) as the final destination/source, nothing works. So I’m guessing there is a special object dealing with table controls. Do I need to add an extra step in the hierarchy navigation .getByName("tableControlName")
? I tried that, and it still didn’t work. Are .currentValue
and .boundField.getString()
(or .getXXX other type) not the right methods for table control columns? They work for regular fields every time.
I can’t find any documentation or questions answered here relating to table controls and how to read/write their column values within macros. I thought it was the same as with other fields, but I’m hitting a roadblock.