Page 1 of 1

Form name 'xxxx' already exists as another form

PostPosted: Mon Aug 13, 2018 7:09 pm
by joe26

I'm seeking to show a table that exists but just want to redraw or reshow a form with slightly different data in the in-memory dataset.

I get a 'form name already exists' error.

I can redraw the table if I show the form and then cancel because then I have access to the table and can remove it from the view.

The table is pre-built but is shown on request. Changing the data throws the error. It seems I cannot dispose of an in-memory data set programmatically. My last bit was through datasource.mem['xxx'].getFoundSet and clear, which didn't release the form to clear from history. My next step would be to momentarily show the view and cancel out since it is the view that is attached to the datasource. With that I may as well just drop out and recreate the view with a diff datasource, leaving the other hanging around.

What is the best way to reshow a form which you cannot remove from history?

I could regenerate the dataset with a new datasource name but that seems awkward and wasteful. It would be nice to dispose of the memory the other takes up already.


Re: Form name 'xxxx' already exists as another form

PostPosted: Mon Aug 13, 2018 11:56 pm
by mboegem
Hi Joe,

should be as simple as generating your new data in a dataset and make a datasource from that dataset with the exact same name as the one you've used on that form.
Then show the form.
Done :-) !

In order to populate data for a in-mem datasource I always use 1 function, so the number of columns, column types, etc. won't change throughout the application.
Besides, if you make sure you can turn an empty dataset into a datasource using such a function, there's your way to clear the in-mem table.

Hope that helps

Re: Form name 'xxxx' already exists as another form

PostPosted: Tue Aug 14, 2018 9:00 am
by joe26
I should know that, but will go at it again.