Dynamics NAV 2013 R2 OData
hubix2000
Member Posts: 3
Hi,
I'm trying to call the page 5404 ("Item Units of Measure") through a web service. Whenever I'll open it I'll get this error "The Item does not exist. Identification fields and values: No.=''". Same error occours when I run this page from within C/Side.
The reason for this is this line:
Question now is: How to set it from an OData call?
Thanks for your help,
Jörg
I'm trying to call the page 5404 ("Item Units of Measure") through a web service. Whenever I'll open it I'll get this error "The Item does not exist. Identification fields and values: No.=''". Same error occours when I run this page from within C/Side.
The reason for this is this line:
OnOpenPage()
Item.GET("Item No.");When I call this page through the OData service Rec.Fields."Item No." is unset.
Question now is: How to set it from an OData call?
Thanks for your help,
Jörg
0
Comments
-
Are you filtering on specific Item when calling the OData?0
-
Hi,
I'm trying to query the data like this;var iUsoM = from iUoM in this.Nav.ItemUnitsOfMeasure select iUoM;
Another try Fails as well:var iUsoM = from iUoM in this.Nav.ItemUnitsOfMeasure where iUoM.Item_No = "1001" select iUoM;
Both results are the same.
The Problem is that Rec.Fields."Item No." is not set and this is used in OnOpenPage().
First line does Item.GET("Item No.");. This Fails.
So, how to set Rec.Fields."Item No." from an OData request?
Kind Regards
Jörg0 -
Hi
If the page is note being called by a valid "Item Unit of Measure" record then the "Item No." will be blank in OnOpenPage trigger.
Try to move your Item.GET code to OnAfterGetRecord trigger and change if to
IF NOT Item.GET(...) THEN
Item.INIT;________________________________
Gunnar Gestsson
Microsoft Certified IT Professional
Dynamics NAV MVP
http://www.dynamics.is
http://Objects4NAV.com0 -
It is correct that not all pages can be exposed succesfully as an OData feed. This is especially true if the page requires a certain context to run.
In those cases you will have to either refactor the page or create a dedicated codeunit/page/xmlport or Query that you can expose.Best regards,
Jens Møller-Pedersen [MSFT]
This posting is provided 'AS IS' with no warranties, and confers no rights.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 328 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
