Baanboard.com

Baanboard.com (http://www.baanboard.com/baanboard/index.php)
-   Tools Development (http://www.baanboard.com/baanboard/forumdisplay.php?f=8)
-   -   how to sort fields in the form (non-index) (http://www.baanboard.com/baanboard/showthread.php?t=70358)

jojovalenton 21st August 2017 20:38

how to sort fields in the form (non-index)
 
hi,

i just want to inquire if possible to sort fields in the form because i need to open the form in diff scenarios using same table but diff sorting of fields. i used query.extend but select only data not fields sorting.

regards,
jojo

VishalMistry 23rd August 2017 10:38

Hi,

Have you tried specifying Order By clause in query.extend.where in before.program section ?

function void query.extend.where (string extension_string [, long mode])

Please use EXTEND_APPEND as mode.

Vishal

jojovalenton 24th August 2017 22:14

hi,
thanks for reply. i tried your suggestions in the before.program: but still the fields do not arrange as per query.select. any missing in my script?

case tcnpc.safety.inspection:
query.extend.select("tcnpc108.ssty, tcnpc108.ssno, tcnpc108.ssdt, " &
" tcnpc108.lctn, tcnpc108.dmgs, tcnpc108.inty, tcnpc108.dept")
query.extend.from("tcnpc108")
query.extend.where("tcnpc108._index1={tcnpc.safety.inspection}", EXTEND_OVERWRITE )
break

regards,
jojo

ashish.k.gupta 25th August 2017 06:07

Hi
you can try query.extend.order("<field name> desc") along with your existing query and if it is index field you can use to.key function

Regards
Ashish


All times are GMT +2. The time now is 18:46.


vB.Sponsors
©2001-2017 - Baanboard.com - Baanforums.com