I created a table meant to provide values to valuelists. At the moment, I created two fields, each providing values to a different list (categories and job description).
To let users easily add or remove items to a valuelist, I created two form with a method the finds only records with valid values in the field. After that, I put those forms in a tabpanel on a “Settings” form.
The method is (the other one is identical, but refers to another form and field):
forms.categorie.controller.find()
forms.categorie.categoria = “%”
forms.categorie.controller.search()
forms.categorie.controller.sort(‘categoria asc’);
And here comes the problem:
the method works fine if launched in its original form but, since I want to refresh the list each time the Settings form is showed, I attached it to OnShow property of the original form. But I get an error (search failed, try to show all) every time I open the Settings form.
After the error, both the methods are triggered correctly switching from a tabpanel to the other.
But I don’t understand what causes the error…
jcompagner:
ok i think i have fixed that problem. Can you test this when RC9 will come out (most likely today or tomorrow)
I’m still having problems with this functionality: now, the first time the form shows up, instead of doing a search (I wrote a simple method that searches a “%” in the ‘profession’ field), it creates a new record with a “%” symbol in that field.
As before, everything occurs the first time you open the form; after that, everything works fine.
HJK:
I had the same problem and I solved it.
try to load the form first with records:
forms.formname.controller.loadAllRecords();
than do the search.
It doesn’t work (I still have the SEARCH FAILED message + empty related record created).
I solved the problem using two different relations, but without this problem I would have saved two relations and two fields