Options

Subform behavior in a page

smalkmussmalkmus Member Posts: 18
edited 2010-05-03 in NAV Three Tier
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

Comments

  • Options
    smalkmussmalkmus Member Posts: 18
    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?
  • Options
    veerendraveerendra Member Posts: 66
    Hi,

    You better look into one standard page example and follow the same...
    Veerendra Ch.
    http://midynav.blogspot.com/ (Microsoft Dynamics Navision)
  • Options
    smalkmussmalkmus Member Posts: 18
    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.
Sign In or Register to comment.