Thanks Juan,
Thank you for reply.
I created form and added above code but different way I am not extending form rather using Main form with sub form which load data using code which you have given in this forum and Main form has search fields.
When form gets loaded in browser it executes above code in onShow() method of subform. Thats working fine
But for searching code in Main Form when I execute below code it throws error : TypeError: Cannot set property "dataSource" of to "mem:MyDataSource"
- Code: Select all
function onSearch()
{
var sql= '<some sql query>'
ds=databaseManager.getDataSetByQuery('servername',sql,null,1000)
var dataSource=ds.createDataSource('MyDataSource') //TypeError: Cannot set property "dataSource" of to "mem:MyDataSource"
var myForm=solutionModel.getForm('subformName')
myForm.dataSource=dataSource;
forms['subformName'].controller.recreateUI()
}
Any idea why it is throwing error TypeError: Cannot set property "dataSource" of to "mem:MyDataSource"