Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

Error Creating Assembly BOM using ODATA Web Service (NAV 2017)

Posted on by 65

I've exposed Page 36 and am using OData to create assembly BOM's.

When I execute the SaveChanges below, I get a crazy error about the item not existing..?? Weird thing is, I first ran this code it ran fine but when I checked  the Assembly BOM in NAV there was an empty line in the BOM. I deleted all the lines in the BOM in NAV and re-ran the code at which time this error started happening.

The error now occurs when I try to add an Assembly BOM to any item. Can anyone shed any light on this problem, additional troubleshooting methods, or services I can restart? I did restart the NAV Server for the instance I'm working with but that had no effect on the error.

 

LocalNAV2017.NAV theNav = new LocalNAV2017.NAV(new Uri(serviceUri));
theNav.Credentials = CredentialCache.DefaultNetworkCredentials;

int lineNo = 10000;
AssemblyBOM newBom = AssemblyBOM.CreateAssemblyBOM("1000", lineNo);
newBom.Type = "Item";
newBom.No = "1100";
newBom.Quantity_per = 1M;
newBom.Unit_of_Measure_Code = "PCS";
newBom.Assembly_BOM = false;
theNav.AddToAssemblyBOM(newBom);

theNav.SaveChanges();


 Here's the Error:

<?xml version=\"1.0\" encoding=\"utf-8\"?><m:error xmlns:m=\"schemas.microsoft.com/.../metadata\"><m:code /><m:message xml:lang=\"en-US\">The Item does not exist. Identification fields and values: No.=''</m:message></m:error>



*This post is locked for comments

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans