Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics RMS (Archived)

Issues with POs in RMS HQ SP4

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Does anyone have issues with the follwing script running at HQ SP4. This runs when one works on a PO. Each time i access an item on the PO, there is a serious lag in having the data populate in the new fields introduced in FP1.

SELECT
ItemID,
PurchaseOrderEntry.StoreID,
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 and PurchaseOrderEntry.ItemID = 78302
AND Purchaseorder.StoreID = PurchaseOrderEntry.StoreID AND (InventoryLocation <> 1)
GROUP BY ItemID, PurchaseOrderEntry.StoreID
UPDATE #TempOrder1
SET QuantityOrdered =
  CASE WHEN ItemDynamic.Quantity - ItemDynamic.QuantityCommitted <= ItemDynamic.ReorderPoint THEN
    ISNULL(ItemDynamic.RestockLevel - (ItemDynamic.Quantity - ItemDynamic.QuantityCommitted + ISNULL(#TempQuantity.OnOrder, 0)), 0)
  ELSE 0
END
FROM ItemDynamic
INNER JOIN #TempOrder1 ON #TempOrder1.ItemID = ItemDynamic.ItemID
AND #TempOrder1.StoreID = ItemDynamic.StoreID
LEFT OUTER JOIN #TempQuantity ON #TempQuantity.ItemID = ItemDynamic.ItemID
AND #TempQuantity.StoreID = ItemDynamic.StoreID

SELECT @@ROWCOUNT AS RecordsAffected

We have increased the SQL tempdb file from 4GB to 8GB but there is still a serious lag in the PO. Anyone have ideas?

*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!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,503 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans