How to identify if list Page is open as Dropdown?

vaxo_jjvaxo_jj Member Posts: 54
Hi All,
Is there any way to identify if list page is open as normal list or as a Dropdown?

Example: I've different type of vendors (identified by Vendor Type field). Dropdown page indicated on vendor table can be only one. I want to see in normal Vendor List page only those vendors which have e.g. Type=Vendor, but when I click Buy-from Vendor No. on Purchase Invoice - I want to see in Dropdown all vendors. If I set filter on Vendor List page - in both cases it will be filtered.

Is there any way to distinguish between them?

Answers

  • aceXaceX Member Posts: 166
    Hi there vaxo_jj

    If I understand you well, you need this on DrillDown trigger on your field:
    DrillVendors - OnValidate()
    VendorRec.SETRANGE(Type, Type::Vendor);
    VendorPage.SETTABLEVIEW(VendorRec);
    VendorPage.RUN
    

    VendorRec Record Vendor
    VendorPage Page Vendor List

    Regards

  • vaxo_jjvaxo_jj Member Posts: 54
    Hi aceX,
    That's not I exactly need, because if you put code in DrillDown trigger - normal functionality of drilling down (showing smaller list page directly under the field) is not available any-more. I want to keep this functionality.
  • Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    Hi,

    The functionality you are asking for is built-in and it is based on conditional/filtered relations

    For example, you have "Buy-from Vendor No." and "Pay-To Vendor No" fields both related to table 23 Vendor. If you change relation on "Buy-from Vendor No." to include filter enabling only vendors having field "Vendor Type" set to Vendor your lookup page will be automatically pre-filtered when you lookup vendor from "Buy-from Vendor No." , and will have no filters applied when you lookup a vendor from "Pay-To Vendor No.".

    Changing relation in fields on a case-by-case basis would be the easiest solution I'd think.

    Slawek
    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
  • DuikmeesterDuikmeester Member Posts: 308
    When a page is dropped down it will run the Page-OnInit but not the Page-OnOpenPage as is the case when the page is fully opened.
  • Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    When a page is dropped down it will run the Page-OnInit but not the Page-OnOpenPage as is the case when the page is fully opened.
    Hmm.. Debugger says someting different... It says that both OnInit and OnOpenPage are fired one after another when you do a lookup. Or am I missing someting?

    Slawek
    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Sign In or Register to comment.