/
/
Correct stock with a reason, without driving it negative
For warehouse teams who want a Dynamics GP stock correction recorded at the right value after a count or damage, by asking their AI assistant.
On this page
Connector
Connect Microsoft Dynamics GP, pick your AI tool and paste the prompt.
The problem
Stock corrections that drive inventory negative
Correcting stock in Dynamics GP after a count or damage means checking the item and site, making sure stock will not go below zero or below what is allocated, and costing it correctly. Lot and serial items need detail a quick adjustment cannot hold.
Without PopdockAI
- Check the item and site are valid
- Look up on hand and allocated quantities
- Work out the value of the change
- Find a negative balance after posting
With PopdockAI
- The item and an active site are confirmed
- Lot and serial tracked items are stopped
- Decreases below zero or below allocated stock are refused
- You see before and after and value, then it creates and reads back
The prompt
Use this prompt
Copy it into any AI tool connected to PopdockAI. Swap the values in braces for your own.
**Objective:** Adjust stock of `{item-number}` at site `{site-id}` by `{quantity-change}` units for reason `{reason}` (default ask), after the user confirms.
Pass `{company}` as `company` on every call (if it is empty, omit `company` and the default company is used). Pass a generous `max-records` (1000). If a result comes back with exactly that many rows, say the result may be truncated.
**Step 1: Item and site**
Call `dynamics-gp-get-iv-item` by `item-number` and `dynamics-gp-get-iv-site` by `site-id`. Stop if either is missing or the site is `inactive`. If the item is lot or serial tracked (`item-tracking-option`), stop: these tools cannot record lot or serial numbers.
**Step 2: Stock**
Call `dynamics-gp-get-iv-item-quantity` by `item-number` and find the row for `{site-id}`. For a decrease, stop if it would take on hand below allocated or below zero.
**Step 3: Confirm**
Ask for the document number and batch number. Value = quantity change times `current-cost`. Show the user exactly what will be written, field by field, and ask for explicit confirmation. Do nothing further without a clear yes. Show item, description, site, on hand before and after, quantity change, unit cost, value, reason, document number, batch.
**Step 4: Write**
1. Call `dynamics-gp-iv-inventory-transaction-add` once with `document-type` (adjustment), `document-number`, `document-date` today and `batch-number`. Do not set `post-to-g-l` unless the user asked.
2. Only if that succeeded, call `dynamics-gp-iv-inventory-transaction-add-line` once with `document-type`, `document-number`, `item-number`, `transaction-quantity` = `{quantity-change}`, `transaction-location` = `{site-id}`, `unit-cost` and `reason-code` when one fits.
If the line fails after the header succeeded, tell the user an empty adjustment document exists. Do not retry a failed write automatically. Report the error exactly as returned.
**Step 5: Verify**
Call `dynamics-gp-get-iv-inventory-transaction` by `document-number` and report what was stored.
**Rules & Guidelines:**
* The only write tools this prompt may call are `dynamics-gp-iv-inventory-transaction-add` and `dynamics-gp-iv-inventory-transaction-add-line`, once each, after Step 3.
**Validation:**
* If `{quantity-change}` is zero or not a number, stop and ask again.Who it's for
One answer, three teams that use it
Warehouse managers
Write off damaged stock fast
Record damage with a reason in one message, and see the value of the write-off before it is saved.
Write off 3 damaged LP-10 printers at the EAST site in Dynamics GP, dropped in the warehouse.
Inventory controllers
Correct counts without negative stock
Decreases that would go below zero or below allocated stock are refused, so orders do not lose their stock.
Adjust CART-12 at MAIN down by 40 in Dynamics GP after the cycle count.
Cost accountants
See the value of every adjustment
Unit cost and total value are shown before you confirm, so write-offs are understood before they post.
What would it cost to write off 10 SD-200 docks at MAIN in Dynamics GP? Record it if under 2,000.
How it works
What PopdockAI does when you ask
You give the item, site, quantity and reason, and your AI assistant checks Dynamics GP stock first. The adjustment is created only after you approve, and it posts to the ledger only if you ask.
01
Ask
You give the item, site, quantity change and reason.
02
Check
It confirms the item and site and stops on lot or serial tracked items.
03
Confirm
You see on hand before and after, unit cost and value, and approve.
04
Create
It creates the adjustment and reads it back, posting only if you ask.
What PopdockAI provides
The tools behind the answer
Ready made tools for Microsoft Dynamics GP and one secure connection to your AI tool. No code, no exports.
microsoft-dynamics-gp-get-iv-item
microsoft-dynamics-gp-get-iv-site
microsoft-dynamics-gp-get-iv-item-quantity
microsoft-dynamics-gp-iv-inventory-transaction-add
microsoft-dynamics-gp-iv-inventory-transaction-add-line
microsoft-dynamics-gp-get-iv-inventory-transaction
This report is built from Get data tools only. PopdockAI applies the row, field and parameter rules your admin sets, and every query is written to the audit trail.
The outcome
Stock corrected with a reason and the right value
Related use cases
More ways to put this data to work
One prompt template with infinite possibilities.
Your AI assistant adapts its approach, tone, and capabilities to match each unique context while you maintain a single, manageable workflow.
Join forward-thinking companies that are transforming their operations with intelligent, secure AI automation.

.webp)
