Options

Accessing Subpage from another page in RTC

bluesoulcurrybluesoulcurry Member Posts: 25
edited 2013-05-22 in NAV Three Tier
Hello,

I have a page "ABC" with a subpage which has name "DEF". I have to SETTABLEVIEW with a Record Variable on the subpage from another page "XYZ".

I am trying this in page "XYZ".
Variables:
RecProfit Record Profit
PgABC PAGE ABC

Code:
PgABC.DEF.FORM.SETTABLEVIEW(RecProfit);

The code compiles fine.

But when I try to run the page "XYZ", I get an error.

Compilation of assembly 'C:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\assembly\Page50003.dll' failed. This can be caused by differences between binaries in your installation or your database. Ensure that all installation components are consistent and up to date. Error details: c:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\source\Page\Page50003.cs(237,25) : error CS0117: 'Microsoft.Dynamics.Nav.Runtime.NavForm' does not contain a definition for 'DEF'.

The strange thing is when I use the same code in the page ABC, it works flawlessly.

CurrPage.DEF.FORMSETTABLEVIEW(RecProfit);

This code works pretty neatly, without raising any error whatsoever.

Can you guys please tell me if I am doing something wrong here? Also, if you know any workaround to set the TABLEVIEW of the SubPage from another page, please let me know.

Thank you guys for all the support. I really appreciate it.

Answers

  • Options
    bluesoulcurrybluesoulcurry Member Posts: 25
    Hello,

    I found a solution to the problem I was facing. I created function SetSubPageRec(VAR ProfitRec) in the page "ABC".

    Function:
    SetSubPageRec(VAR ProfitRec)
    CurrPage.DEF.FORM.SETTABLEVIEW(ProfitRec);
    CurrPage.UPDATE(FALSE);

    Now, the new issue I am facing is that though I use SETTABLEVIEW on the subpage, the subpage doesn't get refreshed. Can you guys please tell me what should I do so that record set with SETTABLEVIEW gets refreshed in the subpage?

    Thanks.
  • Options
    mihail_kolevmihail_kolev Member Posts: 379
    have you got any values in SubFormLink and SubFormView?

    Suggestion: write a function in the subform to set the filters, SETTABLEVIEW might not work properly. Have in mind that SubFormLink and SubFormView store their filters in different filter groups.
    -Mihail- [MCTS]
  • Options
    bluesoulcurrybluesoulcurry Member Posts: 25
    have you got any values in SubFormLink and SubFormView?

    Suggestion: write a function in the subform to set the filters, SETTABLEVIEW might not work properly. Have in mind that SubFormLink and SubFormView store their filters in different filter groups.

    Hey Mihail,

    Thanks for the tip. But solution above worked just fine, the problem was that some developer had written code to delete all records on the OnOpenPage trigger. ](*,)

    It took me many restless hours to figure out why wasn't it working. :lol:

    :thumbsup: Thank you for your reply.
  • Options
    Lars_WestmanLars_Westman Member Posts: 116
    I had the same error message in RTC.

    Many hours later I discovered that RTC crashed if I referenced a rec variable called "Sender" in the code in the table. After changing the name of that variable it worked. To find what caused the error I deleted code step by step until it started working and finally I found it.

    This error occurred in 2009SP1 and 2009R2. Don't know about 2013 yet.
Sign In or Register to comment.