79192826

Date: 2024-11-15 14:45:02
Score: 0.5
Natty:
Report link

When you close and reopen the form, the references to the ChooseFromList and its associated DataTable (oDataTable) become invalid. This happens because the form's UI elements are recreated, and their internal IDs (Unique IDs) may change upon reopening. Therefore, the oDataTable you are trying to access is not the same one that is currently active in the form.

The UniqueID of the DataTable may change between form instances. Instead of checking oDataTable.UniqueID, you should check the ChooseFromList UID provided by the event.

Replace:

if (oDataTable.UniqueID == "CFL_Item")

With:

if (oCFLEvento.ChooseFromListUID == "CFL_Item")

Before accessing oDataTable, check if it is not null to prevent null reference exceptions.

if (oDataTable != null && !oDataTable.IsEmpty)
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Starts with a question (0.5): When you
  • Low reputation (1):
Posted by: TGDEV