Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

RecRef on the Page and filters

(0) ShareShare
ReportReport
Posted on by 715

Hi all,

Hope you are fine!

I've faced with one trouble, and ask your assistance.

NAV 2013 R2

I run page with RecRef:

Name DataType Subtype Length
_RecRef RecordRef
_VarRecRef Variant

    _RecRef.OPEN(23);
    //...few filters are set here 
    _VarRecRef := _RecRef;
    IF PAGE.RUNMODAL(0, _VarRecRef) = ACTION::LookupOK THEN BEGIN
      _RecRef := _VarRecRef;
    END;

And it returns me a right RecRef, that's great. But if user changes filters on page, I can't catch this change. RecRef contains the same filters as it was before PAGE.RUNMODAL. Can I anyhow catch filters from the RecRef?

*This post is locked for comments

  • Verified answer
    Rafael B. Profile Picture
    Rafael B. 715 on at
    RE: RecRef on the Page and filters

    Unexpectedly, it's known issue of NAV 2013 R2. Please, refer the link: community.dynamics.com/.../bug-in-nav-2013-r2-preventing-correct-execution-of-getrecord-setselectionfilter-and-it-39-s-workaround

  • Rafael B. Profile Picture
    Rafael B. 715 on at
    RE: RecRef on the Page and filters

    @Rajasekhar Y And that's impossible in my case. Anyway thanks!

  • Rajasekhar@MS Profile Picture
    Rajasekhar@MS 5,567 on at
    RE: RecRef on the Page and filters

    Hi

    To get the filters you need to define Page variable, Use the RecRef to find the Table ID and run the specific page depends on the Table Id using Case Statement.

  • Rafael B. Profile Picture
    Rafael B. 715 on at
    RE: RecRef on the Page and filters

    @Rajasekhar Y, I use variants at the moment.

    Name DataType Subtype Length

    _RecRef RecordRef

    _VarRecRef Variant

    But I can't catch the filters set by use on the lookup page. Variant returns the same RecordRef as I send to it (please, look carefully at my example).

  • Rajasekhar@MS Profile Picture
    Rajasekhar@MS 5,567 on at
    RE: RecRef on the Page and filters

    Hi

    given links are reference to "How to use Variants" in Navision, so have a try with Variants to get the result.

  • Rafael B. Profile Picture
    Rafael B. 715 on at
    RE: RecRef on the Page and filters

    @Nareshwar R.  I looked through your links but there is no useful info for me. Yes, I've tried to use FieldRef to get new filters, but filters are blank.

    @Rajasekhar Y  I looked through your links but there is no useful info for me.

    I really got stuck with this thing.

  • Rajasekhar@MS Profile Picture
    Rajasekhar@MS 5,567 on at
    RE: RecRef on the Page and filters

    Hi

    Then you need to pass variable as "Variant", refer the below how to use Variant

    msdn.microsoft.com/.../dd338762.aspx

    www.waldo.be/.../the-power-of-variants

  • RE: RecRef on the Page and filters

    Hi,

    Check these links.

    forum.mibuso.com/.../transferring-filters-to-and-from-recordref

    dynamicsuser.net/.../filter-in-recordref

    Try using FieldRef.

    Hope it helps.

  • Rafael B. Profile Picture
    Rafael B. 715 on at
    RE: RecRef on the Page and filters

    And I can't use definite page like PageVar.RUN as I don't know exact table when I run the code.

    Typically, it will be _RecRef.OPEN(_AnyTableNo);

  • Rafael B. Profile Picture
    Rafael B. 715 on at
    RE: RecRef on the Page and filters

    Hi

    Sorry, but it's impossible to use definite page because I don't know exact table when I run this code. Example below is just an example. Actually, instead of _RecRef.OPEN(23); I should use _RecRef.OPEN(_TableNo);

    That's why I need your assistance bevause I don't see the way how to get filters after PAGE.RUNMODAL.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,971 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,846 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans