Breaking news from around the world
Get the Bing + MSN extension
Now Available in Community - MBAS 2019 Presentation Videos
Catch the most popular sessions on demand and learn how Dynamics 365, Power BI, PowerApps, Microsoft Flow, and Excel are powering major transformations around the globe. | View Gallery
2019 release wave 2 Discover the latest updates to Dynamics 365Release overview guides and videos Release Plan | Early Access Availability
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Talent TechTalks | Upcoming TechTalks
I'm trying to add a purchase line to a purchase order in Dynamics NAV (2009 R2 Classic) using web services, but I'm running into a peculiar issue.
Creating a purchase line without defining a No works sans problem. Only when I define a No, like in the example below, I get the following exception:
You cannot enter 'Order' in Integer.
Dim purchaseLine = New PurchaseLine
purchaseLine.Document_No = myPurchaseHeader
purchaseLine.Document_Type = Document_Type.Order
purchaseLine.Document_TypeSpecified = True
purchaseLine.Line_No = 1000
purchaseLine.Line_NoSpecified = True
purchaseLine.Type = Type.Item
purchaseLine.TypeSpecified = True
purchaseLine.No = myItemNo ' Defining No seems to cause the problem.
I've tried creating the purchase line first, without defining No. Which works, but updating it with No defined, results in the same.
purchaseLine.No = myItemNo
It was suggested somewhere to try using 1 and "1" for Document_Type, but that didn't work either.
While googling I found some forums where people had a similar problem, but they didn't get me closer to a solution.
I've also posted this on Stack Overflow.
there is some exceptions based on the version of NAV 2009.
this blog may be useful, please check
I've followed the steps described in the blog, only to get the same result in the end.
Though I learned some new things in the process, my issue remains...
i developed your sample in c#.
using WebApplication2.PurchOrderLineProxy; // web reference
var pLine = new PurchOrderLine();
pLine.Document_No = "104001";
pLine.Document_Type = Document_Type.Order;
pLine.Document_TypeSpecified = true;
pLine.Line_No = 30000; // 3. line, 2 lines already exist
pLine.Line_NoSpecified = true;
pLine.No = "LS-75";
pLine.Type = PurchOrderLineProxy.Type.Item;
pLine.TypeSpecified = true;
pLine.Quantity = 1;
pLine.QuantitySpecified = true;
pLine.Location_Code = "YELLOW";
var service = new PurchOrderLine_Service();
i published page 54 "purchase order subform" as web service (entry in table web service). it was necessary to add fields dodument no, document type and line no (property visible=no) in the page to get them through the web service.
I have published 2 self-made Pages, Purchase Order and Purchase Line (based on the Purchase Header and Purchase Line tables), published as Web Services. My NAV installation is an upgrade from 5.0 to 2009 R2 and only the Classic client is set up for the moment. So it doesn't have any Pages. There's currently no RTC client available, it was never installed. Our external partner has added the necessary objects (like Form 810 Web Services) to our Classic client.
Is it possible to publish the Purchase Order Subform Form as a Web Service?
with nav 2009 its fine. the page is a nav standard page , page 54. exists also as form. add it as new record in table web service.
Well there's the problem... I don't have any Pages, except for the ones I made myself.
Page objects you can export/import from nav 2009R2 demo database
Interesting. I'll give this a go.
that could mean, that when upgrading the target database (nav 2009) was completly empty and you only imported/migrated the nav 5 objects. to get the standard nav 2009 objects (pages, reports, etc.) you can export them from the demo/cronus database shipped with nav 2009 and then import the fob files to your db.
acc. to your error, try following:
pLine.Type = (PurchOrderLineProxy.Type) 2;
to set the type value.
Importing the missing objects is no problem, but now I'm getting errors like "Codeunit 7181 does not exist.". So I'm assuming I'm going to have to import more than just the Pages...
Is it possible to export a Page with all its "references"?
thats a typical migration problem. it seems the upgrade/migrate path was not correct (you started with an empty target database ?)
repeat the complete upgrade path to get a clean, working nav 2009 db.
only import pages 50 and 54, then step by step the needed additional nav objects.
ex/importing a nav object with needed referenced objects is not supported, sorry.
here is a step by step instruction (like i would do that kind of task):
open the global variables list of the pages in page edit mode. there you get most of the referenced nav objects, write down the list and export theses objects as text files.
export pages 50 and 54 as text files.
then import/migrate the objects/text files and try to compile them using F11.
so, step by step, you get the wanted pages in compiled form incl. referenced objects.
also helpful: OM Tools from Idyn.
write your own codeunit and publish it as web service. to get .net classes for the nav tables you can create xmlports per table and use them in the codeunit.
It looks like the upgrade procedure you followed or whoever upgraded is not proper, if you have upgraded correctly you should have got all the pages in your database.
Try to upgrade it properly again.
Running into so many issues while importing the Pages from the RTC Client. Missing Codeunits, table fields, variables, ... My NAV installation is definitely messed up and will need to be fixed.
Thank you all for your time and support.
did you create a sql backup before import the new objects? if not, you'll need to restart the upgrade. but in your case definitly the best way. start with a nav 2009 demo/cronus database and follow the complete upgrade path defined on msdn. upgrade the existing nav objects by text merging.
The problem is corrected with this change in codeunit 422, function FormatValue.
IF NOT EVALUATE(OptionNo,FORMAT(fldRef.VALUE)) THEN
Business Applications communities