Base grid change datafield name

Using a macro, I want to change the data displayed in a grid column from one table field to a different field of the same table.

This was working fine in version 4.2.8.x with the following code:

oForm = ThisComponent.Drawpage.Forms.getByName("MainForm") 
oField = oForm.getByName("TestTable")
oColumn = oField.getByName("FormattedField1")
oColumn.DataField = "MONTH3INFO"
oColumn.Label = "MONTH3INFO"
oColumn.Name = "MONTH3INFO"

I recently found out this version was ending its’ life cycle so I upgraded to v5.0.0.5 and most of my code works fine except for this particular piece. It is a critical part of the system design and I haven’t figured out a way around it.

I receive no errors, the Label, Name and DataField all change properly (used MRI) but the data never changes. However checking BoundField (read only) I see it is still pointing to the previous data field.

I have also gone back and tried v4.4.5.2 and the results were the same.

Finally, I reloaded 4.2.8.x and again the code worked correctly.

Any ideas on how to get this working again will be greatly appreciated.

It’s a bug in Base. Filed Bug report. Problem is with Reload(). Workaround is Unload() then Load().

Problem has been resolved via Bug report #93403. It is scheduled to be included in LO v5.1.4