Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Possible bug when using custom functions in a PageVar.RUNMODAL? (NAV2013R2)

(0) ShareShare
ReportReport
Posted on by 2,245

Hello dear experts! :) 

First of all, I tested this on the spanish localized version on NAV2013R2, different CU applied (including CU12).

Also, I tested this on NAV2013 (no R2) and did NOT happen.

Scenario. 

I was developing a solution that required me to create a custom function on a page to pass some params. When calling the page I did something like this:

[...]

MyPage.SetMyFilters(filter1,filter2);

MyPage.RUNMODAL;

__________

And for some odd reason, when I debug at the point of setting the filters, they are properly set but when the runmodal goes off, they disappear and they save the first one that was ever used (probably per user).

Meaning:

1st execution: 

.- Filter1 := 'test1';

.- Filter2 := 'test2';

RUNMODAL - Correct. Filter1 equals test1 and filter2 equals test2.

2nd execution:

.- Filter1 := 'test3';

.- Filter2 := 'test4';

RUNMODAL - Incorrect. Filter1 equals test1 and filter2 equals test2. It doesn't matter if I close and open up NAV (guessing it has to do with the personalizations being stored on SQL).

I tested this on a standard, not customized NAV functionality and happened too. I tried playing with some of the properties of MyPage (like savevalues and whatnot) but no changes.

For now I just created a SingleInstance codeunit and kept going. I checked partnersource too (like I said before, tried it on CU12, but no luck). NAV2013 works fine.

Anyone encountered a similar situation?

*This post is locked for comments

  • Suggested answer
    Rajasekhar@MS Profile Picture
    5,569 on at
    RE: Possible bug when using custom functions in a PageVar.RUNMODAL? (NAV2013R2)

    Hi

    It seems to be the problem is with your Record, the filters from the rec you are retrieving.

    Please check the copy document or Move negative lines actions on the Sales order in the base navision, here we can find the same case (NA version)

    Regards

    Rajasekhar.Y

  • Suggested answer
    keoma Profile Picture
    32,727 on at
    RE: Possible bug when using custom functions in a PageVar.RUNMODAL? (NAV2013R2)

    hi,

    i assume that MyPage.SetMyFilters(filter1,filter2) is your own developed function. set the parameters filter1, filter2 as VAR parameters.

    regards

  • jcastro Profile Picture
    2,245 on at
    RE: Possible bug when using custom functions in a PageVar.RUNMODAL? (NAV2013R2)

    Yes, there is a need to run that page modally.

    Also, I didn't write it on the post but I do that CLEAR(MyPage) before I start working with it, so everytime it's called it's been cleared before. I do not believe the issues lies there. Plus, I spotted standard functionality misbehaving as well due to this so in this case I do not think it's because of my coding (it could though!).

  • Suggested answer
    Tharanga Chandrasekara Profile Picture
    23,116 on at
    RE: Possible bug when using custom functions in a PageVar.RUNMODAL? (NAV2013R2)

    After you create the Page instance do you Clear the instance??

    Plus why you use RUNMODAL? any specific reason for that?

    Try clearing the page instance after the process is completed.

  • Suggested answer
    Tharanga Chandrasekara Profile Picture
    23,116 on at
    RE: Possible bug when using custom functions in a PageVar.RUNMODAL? (NAV2013R2)

    After you create the Page instance do you Clear the instance??

    Plus why you use RUNMODAL? any specific reason for that?

    Try clearning the page instance after the process is completed.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics NAV (Archived)

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans