Quantcast
Channel: Microsoft Dynamics NAV Forum - Recent Threads
Viewing all articles
Browse latest Browse all 29197

NAV web service throws "cannot enter 'Order' in Integer"

$
0
0

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.

purchaseLineService.Create(purchaseLine)

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

purchaseLineService.Update(purchaseLine)

It was suggested somewhere to try using 1 and "1" for Document_Type, but that didn't work either.

While googling I found someforums where people had a similar problem, but they didn't get me closer to a solution.

Any idea's?

I've also posted this on Stack Overflow.


Viewing all articles
Browse latest Browse all 29197

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>