RickyBelmont
RickyBelmont

Reputation: 639

Reset TFDMemTable to default (no field definitions) at Runtime

I have a raw TFDMemTable at design time. I only activate the same at runtime and simultaneously display data through a grid component. The fields will be defined at runtime depending of its source (API REST) and user case.

At runtime, I need to reset the TFDMemTable to its default. Meaning, remove all the fields definition and accept another fresh data and field definitions.

Currently, the fields set by the first ran during runtime was fixed and it is not accepting any new field definitions. I am contemplating on creating TFDMemTable at runtime but I still have to figure out. I am hoping there is a better way..

Real quick question: How can I reset the TFDMemTable to its default at runtime (no fields definition)?

UPDATE 1:

TFDMemTable will receive JSON data from API. This API throws data with unknown number of columns/fields. Meaning, it can only determine the fields upon received of JSON data. Hence, I'd like that each time I called API, the TFDMemTable should redefine all the fields to be able to capture the API fields.

enter image description here

So, from my understanding, if I could be able to reset the TFDMemTable I could avoid this issue.

Upvotes: 1

Views: 855

Answers (1)

Ken White
Ken White

Reputation: 125708

You can use TFDMemTable.ClearFields to remove all of the existing field definitions.

Upvotes: 1

Related Questions