jojovalenton
21st August 2017, 21:38
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, 11: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, 23: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, 07: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