seoclick
24th August 2009, 19:08
I've created one customised warehouse maintain session to maintain some data about warehouse orders. I've just three fields WH order no, wh pono, and revision no. field which we maintain in a alphabetical order.
For example::
Whorder WHpono Revision
1111 12 A
1111 12 B
1112 10 A
1112 10 B
1112 10 c

Now I want to indroduce a display session in such a way that user can see all entries or only last Revision per order,pono. How can I proceed.

rahul.kolhe22
25th August 2009, 07:45
Hi,
If I have correctly understood your requirement I think query.extend.* functions can be used to achieve your requirements.

let use consider
Table code = table

WHorder field = orno
WHpono field = pono
Revision field = revi

Then
When you want last revision for each order you can write:

query.extend.where("table.orno > table.orno and table.pono > table.pono")
query.extend.order("table.revi desc")

And when you want to see all the records you can then write:
query.extend.where("")
rebuild.query() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_sql_query_extensions_rebuild_query)

Hope it helps you.

Regards,
--Rahul

baan.kmurali
26th August 2009, 14:41
Create a multi occurence display session at generate session(ttadv2290m000) as display session type for that fields and given to user

Marioth
26th August 2009, 17:13
Hi baan.kmurali,

Within LN that session doesn't exist anymore. Only for your info.

Regards,

Mario

seoclick
31st August 2009, 07:03
Hi Rahul,

Thanks for your response. Could u please tell me where should I write the above script. I've written it under the program script but didn't work.
Will I write it under any DAL or BOL??? Please reply....

Regards,
seoclick

rahul.kolhe22
31st August 2009, 15:12
Hi Seoclick,
The query extend which I have mentioned will not work. Sorry for it.
Working around with query extend can solve your problem. You can write the query extend (http://www.baanboard.com/programmers_manual_baanerp_help_functions_sql_query_extensions_query_extend_where) in before.program section in your case in UI script. For detail information you get it in programmers guide.

If I get the solution for your query will add up to this thread.

Regards,
--Rahul

seoclick
7th October 2009, 10:16
Dear Rahul,

The problem has been sorted out with your help.
I've used your code in a function and call it while necessary.

Thanks so much.

Regards,
Seoclick