Page Object as a Parameter

ayla
Member Posts: 3
Hi,
There is a Page DataType in the parameter list option of a function. If I want to pass the current page out to a codeunit function to use the current values of that page, how do a do that?
For example if you are in the Customer Page CurrPage wont work in:
Page:
CodeunitName.FunctionName(Rec, CurrPage);
CodeunitName:
FunctionName(VAR Customer: Record Customer; VAR CustomerCard : Page "Customer Card")
The Page variable must below to 21 and not to 2147483643
Any ideas?
Many Thanks
There is a Page DataType in the parameter list option of a function. If I want to pass the current page out to a codeunit function to use the current values of that page, how do a do that?
For example if you are in the Customer Page CurrPage wont work in:
Page:
CodeunitName.FunctionName(Rec, CurrPage);
CodeunitName:
FunctionName(VAR Customer: Record Customer; VAR CustomerCard : Page "Customer Card")
The Page variable must below to 21 and not to 2147483643
Any ideas?
Many Thanks
0
Comments
-
If you are trying to use the function
FunctionName(VAR Customer: Record Customer; VAR CustomerCard : Page "Customer Card")
As the parameters ask, it need to be a Record from Customer Table plus The page Customer Card...
The error:The Page variable must below to 21 and not to 2147483643
Means that you should pass a var page of Customer Card.
Is there in that codeunit something else that might use what you need but accepts other page id?0 -
Thanks, indeed. I want the entire object available, but it isn't from what I can see, only very specific properties. The object being available for selection in the codeunit parameter implies that the whole object should be available, similar to the Record one, but it isn't. So I would expect to be able e.g. CurrPage.Field.Editable = True / False from within the codeunit for any field or property and have to place the code within the Page itself.
Keeping virtually all bespoke code out of the standard objects and in bespoke object ranges is a preferred development standard. The Form object and still the Page object appear to be primitive in allowing this to happen to the full potential I think.0
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