I want to delete a record in another form when a method is called. In order to do this I need to search through all the records in that form. What I did was get the foundset of a table for that form. However my foundset is empty. I need someone to tell me where I went wrong. Here is the code
var index = designplan_to_activities.getSelectedIndex()
var size = designplan_to_activities.getSize()
var projNum = designplan_to_activities.getDataProviderValue(‘proj_num’)
var pFoundSet = databaseManager.getFoundSet(forms.Projects.controller.getServerName(), forms.Projects.controller.getTableName())
var pRec
for(var i = 1; i < pFoundSet.getSize(); i ++)
{
pRec = pFoundSet.getRecord(i)
Not sure where you are initiating this method from but I assume that it is not projects
In that case there may not be any foundset applicable to the projects table and so Servoy does not know what you want loaded.
You may want to think about preparing the projects table first by running either a search or a getDatSetByQuery() on it to give you some result to loop across
thanks,
my foundset is not empty anymore. However I have another problem. How do I get a value of an element for a specific record after I do a found.getRecord(index)??
var index = designplan_to_activities.getSelectedIndex()
var size = designplan_to_activities.getSize()
var projNum = controller.getDataProviderValue(‘proj_num’)
var pFoundset = databaseManager.getFoundSet(forms.Engineers.engineers_to_projects.getServerName(), forms.Engineers.engineers_to_projects.getTableName())
pFoundset.loadAllRecords()
application.output(‘size’ + ’ ’ + pFoundset.getSize())
for(var i=1; i<= pFoundset.getSize(); i++)
{
eRec = pFoundset.getRecord(i)