Hi,
I've added a subform for comments to the Service Order main form. This form already contained a subform for Service Item Lines.
I now want to filter my comments subform based on what line is selected in the Service Item Lines subform?
i.e. I'm filtering my second subform on the item selected in the first subform.
I want to only show comments that are entered for each service line item.
Is it possible to do this?
Thanks for any help.
0
Answers
Here are some examples:
Multiple Subform Sample v2.0
New Multiple Subform Sample
Sorry for confusion - the service item subform and the comment subform are both on the main service order form - they are not one inside the other.
When I select a service item in the service item subform I want to filter the comment subform to only show comments that apply to the currently selected service item.
It's difficult to explain.
in this form create a subform with the comment lines
then create the mainform and put the first subform in it.
It is not recommended by Navision, but it should work
In his subform for SalesLines he has defined a function called IsSelectedLineChanged and in the code of the OnTimer in his main form he has the following:
// Check if the user has scrolled headers or subform lines.
IF NOT CurrForm.SalesLines.FORM.IsSelectedLineChanged THEN
// Don't do anything if the subform line is still the same as //<TimerInterval>ms ago.
EXIT;
I've done the same in my forms and code but I get the error when I compile:
"You have defined an unknown variable.
IsSelectedLineChanged
Define the variable under 'Global C/AL Symbols'."
It's like the function IsSelectedLineChanged is not visible (in scope) from the mainform.
Anyone some ideas what I'm missing?
Compiler seems to think it's a variable.
Did you assign a name to your subform? Did you use this name in the above statement?
// Check if the user has scrolled headers or subform lines.
IF NOT CurrForm.ServItemLineSubForm.FORM.IsSelectedLineChanged THEN
// Don't do anything if the subform line is still the same as <TimerInterval>ms ago.
EXIT;
See with <F5> if you can locate your function by navigating through CurrForm -> Controls -> <nameofyoursubform> -> Functions -> FORM
Thank you.