I am working on form that need to load all data for today date only.
I have created relationships between tables bound all text fields with respective column in table.
On Show event I want to load all records that are for today date and untill current time.
how can I pass parameter to foundset.loadrecord()
You could use a foundsetfilter:
var vToday = utils.dateFormat(new Date(), 'yyyy-MM-dd')
foundset.addFoundSetFilterParam('date_field', '>=', vToday, 'todayFilter')
mskv1309:
how can I pass parameter to foundset.loadrecord()
//foundset.loadRecords(query, queryArguments)
//e.g.
var dToday = new Date();
dToday.setHours(0, 0, 0, 0);
var dNow = new Date();
foundset.loadRecords("SELECT table.primarykey FROM table WHERE datecolumn >= ? AND datecolumn <= ?", [dToday, dNow]);
//or this might work for you too
foundset.loadRecords("SELECT table.primarykey FROM table WHERE datecolumn >= TODAY() AND datecolumn <= NOW()", []);
Thanks Jdruijn & jgarfield.