Hi,
I’ve created a button to open routejournal for particular prodid, in that second form when I gave any other prodid it doesn’t filter the Routecard journal based on that id.
I declared a queryrange for prodid and gave the value as
productionRange.value(txtBarcode.text());
May I know how to fix this?
Thanks
kranthi
December 26, 2017, 12:40pm
2
Where you are calling this code?
What other changes you have made?
In init method of datasource i gave the range for the query as:
productionRange = ProdJournalTable_ds.query().dataSourceTable(tablenum(ProdJournalTable)).addRange(fieldnum(ProdJournalTable, ProdId));
In executequery:
void executeQuery()
{
;
journalFormTable.datasourceExecuteQueryPre();
productionRange.value(txtBarcode.text());
txtBarcode.text("");
super();
journalFormTable.datasourceExecuteQueryPost();
}
In modified method of that stringedit i called that executequery.
As there is only filtered records in the second form, I think the stringedit filter isn’t working.
May I know how to call the entire table again and filter this record based on the Prodid?
kranthi
December 27, 2017, 11:02am
5
You may have to clear the existing range on PROD Id.
It is being set in journalFormTable.datasourceExecuteQueryPre();
It is already there in executequery method of form datasource…
What shall i do now, Kranthi?
kranthi
December 28, 2017, 7:45am
8
See the below example code. (you may remove the changes in executeQuery and init methods)
public boolean modified()
{
boolean ret;
ret = super();
if (ret)
{
ProdJournalTable_ds.query().dataSourceTable(tablenum(ProdJournalTable)).clearDynalinks();
ProdJournalTable_ds.query().dataSourceTable(tablenum(ProdJournalTable)).clearRange(fieldnum(ProdJournalTable, ProdId));
ProdJournalTable_ds.query().dataSourceTable(tablenum(ProdJournalTable)).addRange(fieldnum(ProdJournalTable, ProdId)).value(queryValue(this.text()));
ProdJournalTable_ds.executeQuery();
this.text(’’);
}
return ret;
}
No Kranthi, that filter doesn’t work still…
You should not be processing transactions in the DAT company, just for reference.
kranthi
December 28, 2017, 11:12am
12
Can you show the changes made?
Yes, Kranthi.
In datasource init method:
void init()
{
super();
journalFormTable.datasourceInitPost(prodJournalTable);
}
in executequery:
void executeQuery()
{
;
journalFormTable.datasourceExecuteQueryPre();
super();
journalFormTable.datasourceExecuteQueryPost();
}
and in stringedit modified method:
public boolean modified()
{
boolean ret;
ret = super();
if (ret)
{
ProdJournalTable_ds.query().dataSourceTable(tablenum(ProdJournalTable)).clearDynalinks();
ProdJournalTable_ds.query().dataSourceTable(tablenum(ProdJournalTable)).clearRange(fieldnum(ProdJournalTable, ProdId));
ProdJournalTable_ds.query().dataSourceTable(tablenum(ProdJournalTable)).addRange(fieldnum(ProdJournalTable, ProdId)).value(queryValue(this.text()));
ProdJournalTable_ds.executeQuery();
this.text(’’);
}
return ret;
}