Natasha
13th January 2003, 14:58
Hello!
I am trying to create display session. In what a way can i get to display only records with distinct value of field.
I used this code:
before.program:
query.extend.select("distinct tdinv800.docn")
But this causes error while compiling.
Does this function use only BaanERP ?
Is there any analogue of this functions in Baan c4?
or is there any other way of the decision of this problem?
jaapzwaan
13th January 2003, 15:36
Indeed, the query.extend.* functions are only available in BaanERP. In Baan IV, there is a string named query.extend that can be set. THe value of this string will be appended to the default generated query at the "where" subclause. (i.e. the query.extend.where function in BaanERP).
The variable can be set in the before.program section.
Regards,
Jaap Zwaan
Natasha
13th January 2003, 15:59
possible you have in the manner of "query.extension", but this is not for me.
I would like to find Predefined Variables, which will be appended to the default generated query at the "select" subclause.
Or the ohter way to display record with distinct value of field
ssbaan
13th January 2003, 16:40
Natasha,
I believe the 'query.extension.' instruction is only for extending the where clause. The 'distinct' clause of the SQL is only for the select of the SQL. Short of buling a temporary table in rhe display
script, or if you have the source - changing the select, I do not know of a short cut way to get unique records.
dnnslbrwn
13th January 2003, 17:32
Have you considered using the section main.table.io? Eg:
main.table.io:
after.read:
if {some condition that you don't want } then
skip.io()
endif
It has been YEARS since I used this, so you should probably check the book for syntax.
Cheers,
-Dennis
nick_rogers
13th January 2003, 19:54
you could make a new index on the table, to filter out the records you do not want to see, and then modify the session to use this new index or add it and allow the user to change to and use the new index.
Or you could code somthing in the main.table.io section based on checking against the previous value of a field, and skip if needed.