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)

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

I have the same question (0)
  • Suggested answer
    Tharanga Chandrasekara Profile Picture
    23,118 on at

    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.

  • Suggested answer
    Tharanga Chandrasekara Profile Picture
    23,118 on at

    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.

  • jcastro Profile Picture
    2,245 on at

    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
    keoma Profile Picture
    32,729 on at

    hi,

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

    regards

  • Suggested answer
    Rajasekhar@MS Profile Picture
    5,569 on at

    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

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)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans