Skip to main content

Notifications

Microsoft Dynamics RMS forum

Error #-2147217833 in PO

Posted on by 30

I'm getting this error when I trying to create a purchase order and/or transfer inventory out.

Store Operations Business Rules
    Error #-2147217833
    The statement has been terminated.
    (Source: Microsoft OLE DB Provider for SQL Server)
    (SQL State: 01000)
    (NativeError: 3621)
    No Help file available

    SELECT
    ItemID,
    SUM(CASE POType
      WHEN 0 THEN QuantityOrdered - QuantityReceivedToDate
      WHEN 1 THEN QuantityOrdered - QuantityReceivedToDate
      WHEN 2 THEN QuantityOrdered - QuantityReceivedToDate
      WHEN 3 THEN -QuantityOrdered + QuantityReceivedToDate
      WHEN 4 THEN QuantityOrdered - QuantityReceivedToDate
      WHEN 5 THEN -QuantityOrdered + QuantityReceivedToDate
    END) As OnOrder
    INTO ##TempQuantity
    FROM PurchaseOrderEntry
    INNER JOIN PurchaseOrder ON PurchaseOrder.ID PurchaseOrderEntry.PurchaseOrderID
    WHERE (PurchaseOrder.Status <> 2) AND (QuantityReceivedToDate <
QuantityOrdered) GROUP BY ItemID
    UPDATE ##TempOrder
    SET QuantityOrdered       CASE WHEN Item.Quantity - Item.QuantityCommitted <= Item.ReorderPoint
THEN
      ISNULL(Item.RestockLevel - (Item.Quantity - Item.QuantityCommitted +
ISNULL(##TempQuantity.OnOrder, 0)),

This is followed by an OK button.  When I click OK, I receive a second
error message:

    Store Operations Manager
    Run-time error '5':
    Invalid procedure call or argument

Also followed by an OK button, which when clicked, exits Store Operations
Manager.  This error is only occurring on one Department, and did not occur
on Monday when this Department was last ordered.  Does anyone know what
causes this error, and how can it be fixed?

 

*This post is locked for comments

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Error #-2147217833 in PO

    thanks it worked

  • Craig Harris Profile Picture
    Craig Harris 795 on at
    RE: Error #-2147217833 in PO

    I run the following select statements to find the "problem" value. Can add other fields to check.. reorderpoint etc

    /* ***********************************************  */

    select * from VIEWONORDER

    WHERE onorder > '10000' OR onorder < '-10000'

    select * from VIEWONXFRIN

    WHERE XFRIN > '10000' OR XFRIN < '-10000'

    select * from VIEWONXFROUT

    WHERE XFROUT > '10000' OR XFROUT < '-10000'

    /* ***********************************************  */

    SELECT itemlookupcode, description, supplierid, quantity FROM Item

    WHERE Quantity > '10000' OR Quantity < '-10000'

    select ItemID, PurchaseOrderID, Itemdescription, lastupdated, Quantityreceivedtodate, quantityordered from purchaseorderentry where quantityordered > '10000' OR quantityordered < '-10000'

    Order by QuantityOrdered DESC

    select * from purchaseorderentry where quantityordered > '10000' OR quantityordered < '-10000'

    Order by QuantityOrdered DESC

    select * from purchaseorderentry where Quantityreceivedtodate > '10000' OR Quantityreceivedtodate < '-10000'

    Order by QuantityOrdered DESC

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Error #-2147217833 in PO

    so how can i fix it

  • Craig Harris Profile Picture
    Craig Harris 795 on at
    RE: Error #-2147217833 in PO

    My 2 bits... I just had this error again. Turned out this time one of our employees had scanned a upc into a Restock level.

    Cheers,

    Craig

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Error #-2147217833 in PO

    i have already solved this issue. my error was same but related to Inventory Valuation Report for which when checked at back end in ItemValueLog Table, i came to find out that OldAmount feild had a value which was out of the range which was initially causing problem. so for that i ran a query to modify the record instead of deleting the particular transaction. the query is as follows which would help others if they ever face the same issue or even with quantity issues related to same error this query can be used changing few things here and there.

    update [Sample].[dbo].[ItemValueLog]

     set OldAmount= 3.46

     where ItemID= 3107

    Cheerz

    Ashish

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Error #-2147217833 in PO

    You need to check the quantity fields in each item.  The best way to do that is open SO Admin and connect to database.  Then run a query

    SELECT * FROM Item WHERE Quantity > 10000 OR WHERE Quantity < -10000

    This was supplied in Archelle Marcito  response above.  

    This could happen with any report that has item quantity or any numeric integer field.  Sine the number is larger than what the reporting engine can handle.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Error #-2147217833 in PO

    same error faced by me but while generating Inventory valuation report. the affected area is transactions. once i delete all transactions the report starts to work but unfortunately transactions are important for reporting purpose therefore needs to be solved somehow using query at SQL back end.

  • Suggested answer
    archelle16 Profile Picture
    archelle16 1,735 on at
    RE: Error #-2147217833 in PO

    Maybe this will help you:

    This problem can be caused by item having an overly large positive or negative inventory quantity and the new Details view in the Transfer and Purchase Order with FP1 when you try to query the details for the items linked to a supplier, but cannot because while processing the query the quantity is greater than the field size. The overly large quantity can normally be caused by scanning the barcode into the item's quantity field.

    To resolve this issue, use the script below as a starting point to find the trouble item. Then update the quantity of the trouble item to a smaller inventory quantity. 

    SELECT * FROM Item WHERE Quantity > 10000 OR WHERE Quantity < -10000

    Source: http://support.microsoft.com/kb/2447570

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

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,802 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,133 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,154

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans