krobinson98
29th January 2009, 23:45
I want to filter data in a session similar to the "Effective currency rates only" function under the specific tab in ERPLN currency rates session tcmcs0108m000 for a custom session I've created. There are two things I don't understand.
1) How do you add a check in front of a form command label that displays under the specific menu as is done in the session tcmcs0108m000 as I described above.
2) I can filter data initially by using query.extend.where() under the before.program session but how do you then modify the filtered data when a user selections a form command under the specific menu which fires a function. What code would be in your function to modify the filtered data?
Thanks for any help
NPRao
30th January 2009, 03:40
1) How do you add a check in front of a form command label that displays under the specific menu as is done in the session tcmcs0108m000 as I described above.
Refer to the source code of the original session
group.1:
init.group:
set.checked.command("show.current.rates", current.rates)
This is a new LN (7.6) Tools function, the online manual on the forum is 7.3 Tools.
set.checked.command()
Syntax:
function void set.checked.command (string command, boolean checked)
Description
Use this to check or uncheck a command in the menubar or the toolbar. This can be used to indicate to the user that the command is activated. Example:
Passing TRUE as the 2nd argument to this function will place a check mark in front of the command in the menubar. If the command is also shown as a toolbar icon then the icon will appear pressed.
Arguments
string command The name of the form command that must appear checked or unchecked.
boolean checked Specify TRUE if you want the command to appear checked. Specify FALSE to show the command unchecked.
Context
This function can be used in all script types.
Your 2nd question is not clear. The original session's form command, just calls a function
function extern void show.current.rates()
{
DllUsage
This form command applies a filter to the rates.
If the filter is applied then only the current rates
are displayed.
EndDllUsage
current.rates = not current.rates
fill.query.extend()
rebuild.query()
execute(first.set)
set.checked.command("show.current.rates", current.rates)
|* Function 'set.checked.command' places a check before the form command
|* in the specific menu if the filter has been applied.
}
You do not have to customize the session to limit the data. You can explore to use the Tools Role - Table Data Authorization.