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:
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
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I'm trying to query the data like this;
Another try Fails as well:
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örg
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.com
In those cases you will have to either refactor the page or create a dedicated codeunit/page/xmlport or Query that you can expose.
Jens Møller-Pedersen [MSFT]
This posting is provided 'AS IS' with no warranties, and confers no rights.