web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Item number/location code does not exist in inventory

(0) ShareShare
ReportReport
Posted on by

Hi  All,

Could you please help on below issue.

got error Item number/location code does not exist in inventory while creating sales order using an eConnect .

even item in inventory table contains location code.

*This post is locked for comments

I have the same question (0)
  • Mick Egan Profile Picture
    3,561 on at
    RE: Item number/location code does not exist in inventory

    Is the Location Code for the Sales Order Header different than the Sales Item Location Code.  Maybe the Header Location Code isn't assigned to the Item.

    Mick

  • Community Member Profile Picture
    on at
    RE: Item number/location code does not exist in inventory

    Hi Mick,

    The item having location code in inventory table.

    i am using eConnect to connect my .net application to the Dynamic GP

    and below lines are code for creating sales order.

    using (eConnectMethods eConnectMethods = new eConnectMethods())

                   {

                       taSopLineIvcInsert_ItemsTaSopLineIvcInsert[] LineItems = new taSopLineIvcInsert_ItemsTaSopLineIvcInsert[lstItemsDet.Count];

                       SOPTransactionType salesOrder = new SOPTransactionType();

                       taSopHdrIvcInsert salesHdr = new taSopHdrIvcInsert();

                       int lineItemCount = 0;

                       foreach (var item in lstItemsDet)

                       {

                           taSopLineIvcInsert_ItemsTaSopLineIvcInsert salesLine = new taSopLineIvcInsert_ItemsTaSopLineIvcInsert();

                           salesLine.CUSTNMBR = "PLAZAONE0001";

                           salesLine.SOPTYPE = 2;

                           salesLine.DOCID = "STDORD";

                           salesLine.QUANTITY = item.Quantity;

                           salesLine.ITEMNMBR = item.ItemNo;

                           salesLine.UNITPRCE = item.UnitPrice;

                           salesLine.XTNDPRCE = item.UnitPrice * item.Quantity;

                           salesLine.DOCDATE = objPODet.OrderDate;

                           salesLine.UOFM = "EACH";

                           salesLine.PRCLEVEL = "RETAIL";

                           salesLine.NONINVEN = 0;

                           salesLine.LOCNCODE = "WAREHOUSE";

                           LineItems[lineItemCount] = salesLine;

                           lineItemCount++;

                       }

                       salesHdr.CUSTNMBR = "PLAZAONE0001";

                       salesHdr.SOPTYPE = 2;

                       salesHdr.DOCID = "STDORD";

                       salesHdr.BACHNUMB = "BI";

                       salesHdr.DOCDATE = objPODet.OrderDate;

                       salesHdr.CUSTNAME = objPODet.CusterName;

                       salesHdr.ShipToName = objPODet.ShipTo_Name;

                       salesHdr.ADDRESS1 = objPODet.StreetNo;

                       salesHdr.CITY = objPODet.City;

                       salesHdr.STATE = objPODet.State;

                       salesHdr.ZIPCODE = objPODet.Zipcode;

                       salesHdr.COUNTRY = objPODet.Country;

                       salesHdr.SUBTOTAL = amount;

                       salesHdr.DOCAMNT = amount;

                       salesHdr.USINGHEADERLEVELTAXES = 0;

                       salesHdr.CSTPONBR = objPODet.OrderID;

                       salesOrder.taSopHdrIvcInsert = salesHdr;

                       salesOrder.taSopLineIvcInsert_Items = LineItems;

                       eConnectType eConnect = new eConnectType();

                       SOPTransactionType[] MySopTransactionType = new SOPTransactionType[1] { salesOrder };

                       eConnect.SOPTransactionType = MySopTransactionType;

                       // Serialize the master vendor type in memory.

                       MemoryStream memoryStream = new MemoryStream();

                       XmlSerializer xmlSerializer = new XmlSerializer(eConnect.GetType());

                       // Serialize the eConnectType.

                       xmlSerializer.Serialize(memoryStream, eConnect);

                       // Reset the position of the memory stream to the start.              

                       memoryStream.Position = 0;

                       // Create an XmlDocument from the serialized eConnectType in memory.

                       XmlDocument xmlDocument = new XmlDocument();

                       xmlDocument.Load(memoryStream);

                       memoryStream.Close();

                       // Call eConnect to process the XmlDocument.

                       eConnectMethods.CreateEntity(connectionString, xmlDocument.OuterXml);

                   }

    Thanks and Regards

    Vamsikrishna T

  • Mick Egan Profile Picture
    3,561 on at
    RE: Item number/location code does not exist in inventory

    One previous Post mentions to check if using Extended pricing , and an additional flag is required.

    My next step would be to run SQL profiler when running the integration and see what the executed stored procedure is passing through, you can see this after the encrypted text sections which run a long way down the window.

    Stop profiler as soon as the error occurs.

    Mick

  • Community Member Profile Picture
    on at
    RE: Item number/location code does not exist in inventory

    Hi Mick,

    I am new to the Dynamic GP,Could you please tell me, what flag required?

  • Mick Egan Profile Picture
    3,561 on at
    RE: Item number/location code does not exist in inventory

    Tim Foster mentions a flag in a previous post, haven't personally tested, but one for consideration.  I would certainly look at SQL Profiler to check what is actually being passed in econnect.

    community.dynamics.com/.../162785

    We do plenty of integrations using Smartconnect and never have this issue.

    Mick

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans