Accessing Subpage from another page in RTC

bluesoulcurry
Member Posts: 25
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.
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.
0
Answers
-
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.0 -
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]0 -
mihail_kolev wrote: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.
:thumbsup: Thank you for your reply.0 -
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.Lars Westman
http://www.linkedin.com/in/larswestman1
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions