web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
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

I have the same question (0)
  • Rajasekhar@MS Profile Picture
    5,569 on at

    Hi

    Instead of Page.RUNMODAL define Page variable and use SetRecord and GetRecord functions of the Page Variable to get the filtered record ,you can refer the below.

    msdn.microsoft.com/.../dd338718.aspx

  • Rafael B. Profile Picture
    715 on at

    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.

  • Rafael B. Profile Picture
    715 on at

    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);

  • Nareshwar Raju Vaneshwar Profile Picture
    5,596 on at

    Hi,

    Check these links.

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

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

    Try using FieldRef.

    Hope it helps.

  • Rajasekhar@MS Profile Picture
    5,569 on at

    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

  • Rafael B. Profile Picture
    715 on at

    @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
    5,569 on at

    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
    715 on at

    @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
    5,569 on at

    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
    715 on at

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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans