eric.dizon
11th February 2014, 23:10
Hi,

How to emulate like filtering in the Specific Menu e.g. if i have a form command that is for "Show only Open Orders". HOw can you manipulate it being a a boolean field when it is activated it is checked and if not is not checked...


Regards,

Eric

bhushanchanda
12th February 2014, 05:56
Hi,

In the form commands for a particular session, do these things:-

1. Activate:- Function
2. Command Type:- Form
3. Category:- View
4. Availability:- Show as Button in Dialog or Browse Session

Now, you can write a function for the value assigned to this menu option.

And, you can handle the menu items with gbf.* functions.

JaapJD
12th February 2014, 12:22
I think you are looking for the functionality of the set.checked.command() function. Look at the example in the programmers guide.

bhushanchanda
12th February 2014, 12:32
I think you are looking for the functionality of the set.checked.command() function. Look at the example in the programmers guide.

Thanks Jaap. Didn't interpreted it correctly.

eric.dizon
12th February 2014, 16:06
Thanks Jaap and bhushanchanda; I will try your suggestions.

eric.dizon
12th February 2014, 17:37
I have tried your suggestions but I have issue in query.extend.where
when it filters what I need it cannot revert back to the original selection any suggestion why ?


function extern void set.filter.only.open()
{

static boolean filter.active

| Toggle the filter
filter.active = not filter.active

| Change the appearance of the form command
set.checked.command("set.filter.only.open", filter.active)

| The filter implementation...
if filter.active then
query.extend.from("cxcsb005")
query.extend.where("cxcsb005.stat < 50", EXTEND_OVERWRITE)
execute(start.query)
else
query.extend.from("cxcsb005")
query.extend.where("cxcsb005.stat > 0", EXTEND_OVERWRITE)
execute(find.data)
endif


}

eric.dizon
12th February 2014, 17:38
sorry I figured it out I have to execute(start.query) on both instances. Thanks again.

JaapJD
12th February 2014, 19:02
I would prefer

query.extend....
rebuild.query()
execute(find.data)

Although the execute(start.query) may work, it is not meant for this.

eric.dizon
12th February 2014, 19:36
Thanks Jaap. If this is best practice this would be handy.