/
/
Find items sold below cost or under target margin
For finance and pricing teams who want Dynamics GP price lists and real invoice prices checked against cost, by asking their AI assistant.
On this page
Connector
Connect Microsoft Dynamics GP, pick your AI tool and paste the prompt.
The problem
Margins slip as costs rise and discounts pile up
Prices in Dynamics GP drift out of line with cost as purchase prices rise, and order discounts drift further still. Finding items sold below cost or under target means comparing price lists, costs and invoice lines in separate screens.
Without PopdockAI
- Export item costs and price lists from Dynamics GP
- Work out the margin on each price in a spreadsheet
- Pull invoice lines to see what was really charged
- Miss the customers getting the deepest discounts
With PopdockAI
- Margins are worked out on each currency price, with skipped rows named
- Recent invoice lines give the margin you actually achieved
- The lowest price charged is shown with the customer
- It only reads and never changes a price
The prompt
Use this prompt
Copy it into any AI tool connected to PopdockAI. Swap the values in braces for your own.
**Objective:** For items in class `{item-class-code}` (default all), flag list prices and actual selling prices that fall below cost or below a `{min-margin-percent}` percent margin (default 20), using sales from the last `{lookback-days}` days (default 90).
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: Items and cost**
Call `dynamics-gp-get-iv-item` with `item-class-code` when given. Note `current-cost` and `standard-cost`. Skip items with no cost.
**Step 2: Price lists**
Call `dynamics-gp-get-iv-item-price` for those items (by `item-number`). Margin = (price minus `current-cost`) divided by price. Flag rows below cost and rows below the target margin. Note the `price-method`; for percent-based methods the stored value is not a currency price, so evaluate only currency-amount rows and say which were skipped.
**Step 3: Realised prices**
Call `dynamics-gp-get-rm-sales-line-item` with `document-date.from` at the lookback. For invoice lines of these items, realised margin = (`extended-price` minus `extended-cost`) divided by `extended-price`. Per item: quantity, revenue, realised margin, lowest unit price charged and to whom.
**Step 4: Report**
* Items priced below cost (item, level, unit, price, current cost).
* Items under target margin on the price list.
* Items under target margin in actual sales, worst first by revenue at risk, with the customers who got the lowest prices.
* Items whose realised price is well under their list price (average discount over 15 percent).
**Rules & Guidelines:**
* This prompt is read-only. Do not call any tool whose name does not contain `get` (no add, update, note or email tools).
* Do not call `dynamics-gp-iv-item-price-update`; the separate `update-item-prices` prompt changes prices.
**Validation:**
* If no items match, say so and stop.Who it's for
One answer, three teams that use it
Finance controllers
See items selling below cost
Items priced or sold below cost are listed first, so the worst leaks are fixed before more stock goes out the door.
Which Dynamics GP items in the PARTS class sold below cost in the last 60 days?
Pricing analysts
Check list prices against target margin
Each price list row is tested against your target, so you know which prices to raise after a cost increase.
Check our Dynamics GP RETAIL class price lists against a 40 percent margin target.
Sales managers
Find the deepest customer discounts
Items discounted more than 15 percent on average and the lowest price charged show which deals need a conversation.
Which customers got the lowest prices on our OFFICE class items in Dynamics GP over the last quarter?
How it works
What PopdockAI does when you ask
You choose an item class, a target margin and a lookback window, and your AI assistant compares Dynamics GP prices and sales with cost. It reports the leaks and leaves every price as it is.
01
Ask
You choose an item class, a target margin and a lookback window.
02
Read
It reads item costs and price lists and works out each price's margin.
03
Compare
It reads recent invoice lines for achieved margin and the lowest price charged.
04
Report
You get items below cost, under target or discounted over 15 percent.
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-item-price
microsoft-dynamics-gp-get-rm-sales-line-item
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
Margin leaks found by item and customer
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)
