Subform behavior in a page

smalkmus
Member Posts: 18
Hello,
I have a form and a page that are supposed to have identical behavior. The form is behaving correctly but the page is behaving eratically. I'm wondering if somebody can look at what I'm trying to do and see if anything comes to mind that would explain the behavior I'm seeing.
The page has a text box, a grid, and a subform. The data in the subform needs to be filtered based on the selection in the text box. The text box is unbound and contains a custom lookup. What I have done is added a Set method on the subform that I call in the OnValidate of the text box. The method passes the selection to the sub-form, sets the filter of the sub-form, and refreshes the form. Here's the code:
.......................
SetKeyData(_keydata : Text[10])
Rec.RESET;
Rec.SETFILTER("Key Data Field", '=%1', _keydata);
CurrPage.UPDATE(FALSE);
....................
This should filter the values displayed in the sub-form based on the selection in the text box on the main form. This works perfectly on the classic client form version, but what I'm seeing in the RTC page version is that the values in the sub-form are somehow being filtered based on the selection in the main page grid. The key in the sub-form table is a single field. The table in the sub-form is not related to the table in the main form but the table in the main form does include the same field which is used as a key in the sub-form. I have been stuck on this for a while. I don't see any table relations that are defined. The SourceTableView property on the sub-form is not set. The SubFormView and SubFormLink properties on the main form are also not set. I'm at a loss as to what could be causing this relationship to be happening automatically. I figure there must be a setting somewhere that is causing this to happen but I can't seem to find it. If anyone has any suggestions or ideas on why this might be happening, it would be a huge help.
Thanks!
Adam
I have a form and a page that are supposed to have identical behavior. The form is behaving correctly but the page is behaving eratically. I'm wondering if somebody can look at what I'm trying to do and see if anything comes to mind that would explain the behavior I'm seeing.
The page has a text box, a grid, and a subform. The data in the subform needs to be filtered based on the selection in the text box. The text box is unbound and contains a custom lookup. What I have done is added a Set method on the subform that I call in the OnValidate of the text box. The method passes the selection to the sub-form, sets the filter of the sub-form, and refreshes the form. Here's the code:
.......................
SetKeyData(_keydata : Text[10])
Rec.RESET;
Rec.SETFILTER("Key Data Field", '=%1', _keydata);
CurrPage.UPDATE(FALSE);
....................
This should filter the values displayed in the sub-form based on the selection in the text box on the main form. This works perfectly on the classic client form version, but what I'm seeing in the RTC page version is that the values in the sub-form are somehow being filtered based on the selection in the main page grid. The key in the sub-form table is a single field. The table in the sub-form is not related to the table in the main form but the table in the main form does include the same field which is used as a key in the sub-form. I have been stuck on this for a while. I don't see any table relations that are defined. The SourceTableView property on the sub-form is not set. The SubFormView and SubFormLink properties on the main form are also not set. I'm at a loss as to what could be causing this relationship to be happening automatically. I figure there must be a setting somewhere that is causing this to happen but I can't seem to find it. If anyone has any suggestions or ideas on why this might be happening, it would be a huge help.
Thanks!
Adam
0
Comments
-
Looks like I was incorrect. The subform is showing all the records in the sub-form table, it's not filtering at all. What happens is, when I create a new record in the main form grid, the sub-form becomes blank. When I select a record in the main form, the sub-form shows all of the records in the sub-form's table. Is there any way to programatically set the filter on the the sub-form? I do not have a direct link from the main-table to the sub-form table to set the SubFormLink property. Any suggestions?0
-
Hi,
You better look into one standard page example and follow the same...Veerendra Ch.
http://midynav.blogspot.com/ (Microsoft Dynamics Navision)0 -
veerendra wrote:Hi,
You better look into one standard page example and follow the same...
That's a good idea. Can anyone suggest a standard page in NAV where the sub-form data is filtered without using the SubFormLink property? I've searched around and haven't found one yet.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions