Showing Subform control on fasttab of Customer Card page

havhav Member Posts: 299
edited 2009-04-23 in NAV Three Tier
Hi all,
I have created a new table called "WM Special Terms" having fields as Account (Code(8)), Product(Code(4)) and Discount(Decimal). The table is populated with relevant data.
Next I have created a new tabular form (page) "Special Terms" having source table as "WM Special Terms". On running this form(page), the source table data is displayed.
Further I have customized the "Customer Card" by adding a new tab(fasttab) called "Special Terms". On this tab, I have added two subform controls, say Subform1 and Subform2, both having SubFormID/PartID = "Special Terms" (form/page) but using different filters to display the data.
After transforming the form to page using the transformation tool, when i run the "Customer Card" in RTC, i see the "Special Terms" fastab displaying both "Subform1" & "Subform2". I also see "Actions" flash-button on both of the subforms. When i click this button on say "Subform2", a menu-option "Part > Remove" is displayed. Un-doubtedly i clicked this menu and the "Subform2" disappeared allowing "Subform1" to expand and occupying the whole content area.
The problem now is how do i get back "Subform2" again on "Customer Card" page.
Any idea!

Thanks,
Hemant
Regards,
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)

Comments

  • kinekine Member Posts: 12,562
    Try to add the subforms into Frames to have them in different group on the page. May be it will help. In some "non-standard" situations (as two subpages on one Fasttab) the client can behive in a strange way. Not every situation which developer can create is handled correctly.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • havhav Member Posts: 299
    Yes i do have placed subforms into frames so that they are contained in a group on page.
    Anyway, i could not locate how to get back "Subform2" on the fasttab so i have no options than to restore the backup db.

    Coming to next problem...
    The sub-forms are kept to display filtered data as per below criteria:
    --> "Subform1" will display only those special terms that are applicable to current customer
    --> "Subform2" will display those special terms that are generally applicable to all customers
    Note that both subforms have the same source table.
    I have written two functions on the actual form "Special Terms" to serve the above two purposes. One function is FilterSpecificTerms("No.") and the other is FilterGeneralTerms("No.") .
    These two functions are called from "OnAfterGetRecord()" of Customer Card.
    OnAfterGetRecord()
    BEGIN
         --------
         CurrForm.SubForm1.FORM.FilterSpecialTerms("No.");
         CurrForm.SubForm2.FORM.FilterGeneralTerms("No.");
    END;
    

    In NAV 5.0 when i open Customer Card and go to "Special Terms" tab, both subforms display correctly filtered data.
    However after transforming these form to page, when i view "Customer Card" page in NAV 2009 RTC, both subforms display all data and i do not see any filter being applied.

    Am i missing something w.r.t. filtering on page object.
    Regards,
    Hemant
    MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
  • havhav Member Posts: 299
    Also the two subforms are placed on a single fasttab!
    Regards,
    Hemant
    MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
  • kinekine Member Posts: 12,562
    Check the Transformation toolkit log file after transforming the forms for more info what's going on. The calls to subform functions can be wrongly transformed. And may be you need to setup somehow that the frames means new fasttabs during the transformation...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • havhav Member Posts: 299
    The frame do transform to a new fasttab as it is mapped to 'Group'.
    Also i have decreased the indentation in page designer so as to allow both subforms to appear in different fasttabs.
    I can see two different fasttabs however they do not filter the data as expected.
    Do you want me to paste the function code here.
    Regards,
    Hemant
    MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
  • freddy.dkfreddy.dk Member, Microsoft Employee Posts: 360
    I don't know if I understand the problem correctly here - but if you look at the Sales Order Page, the lines part is not included in any group - the part will become a group in itself.
    Have you tried to do that?
    I wouldn't expect the client to like two parts in one fasttab (which you confirmed in this post)
    Freddy Kristiansen
    Group Program Manager, Client
    Microsoft Dynamics NAV
    http://blogs.msdn.com/freddyk

    The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
  • havhav Member Posts: 299
    The problem is that the subform control on the Customer Card page does not filter records specific to current customer record.
    For the time being forgot my filter function.
    You can visualize the setup as below:
    "Special Terms" is a table with "Account", "Product" & "Discount" field. The table is populated with data. It has ("Account, "Product") as the primary key. "Account" is mapped to "No." of Customer table.
    The Customer page is modified by adding a subform control "Special Terms" as a part.
    The SubformLink property of this part is set to Account = FILTER("No.").
    Now when i run the Customer page and click on "Special Terms" fasttab, it shows me all records from "Special Terms" table instead of the records belonging to current customer.

    It sounds as if the FILTER() is not working!
    Regards,
    Hemant
    MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
Sign In or Register to comment.