/
/
Authorize returns against a real sale at the right price
For support and operations teams who want a Dynamics GP return raised with the right codes and price, by asking their AI assistant.
On this page
Connector
Connect Microsoft Dynamics GP, pick your AI tool and paste the prompt.
The problem
Return authorizations raised against no real sale
Raising a customer return in Dynamics GP means checking the customer bought the item, finding the invoice price and picking return codes from setups you rarely see. If the line fails after the header, you are left with an empty RMA.
Without PopdockAI
- Search the customer's sales history for the item
- Look up the price on the last invoice
- Guess the return type and reason code
- Clean up an empty RMA when the line fails
With PopdockAI
- Sales history is checked, with a warning if they never bought it
- The last invoice price is used
- Return codes already in use are reused, or it asks
- You confirm every field, and an empty RMA is reported if a line fails
The prompt
Use this prompt
Copy it into any AI tool connected to PopdockAI. Swap the values in braces for your own.
**Objective:** Create a return (RMA) for `{quantity}` of `{item-number}` from `{customer-name}` because `{reason}` (default ask), after checking the sale and getting the user's confirmation.
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: Customer and address**
Call `dynamics-gp-get-rm-customer` with `customer-name.contains` (or `customer-id`); if several match, list them and stop. Call `dynamics-gp-get-rm-customer-address` by `customer-id` for the `address-code` to use.
**Step 2: Was it sold to them?**
Call `dynamics-gp-get-rm-sales-line-item` by `customer-id` and `item-number`. Take the most recent invoice line's `unit-price` and `sop-number`. If they never bought the item, or bought fewer than `{quantity}`, warn the user.
**Step 3: Codes to reuse**
Call `dynamics-gp-get-srv-rma` by `customer-id` (or unfiltered, a few rows) to see the `return-record-type`, `return-type` and `return-status` values in use, and `dynamics-gp-get-srv-rma-line` for `rma-reason-code` values. Pick the reason code that fits `{reason}`, or ask.
**Step 4: Confirm**
Ask the user for the RMA number (return document id) and the site it returns to. Show the user exactly what will be written, field by field, and ask for explicit confirmation. Do nothing further without a clear yes. Show customer, address, RMA number, type, reason code, item, quantity, unit price, original invoice.
**Step 5: Write**
1. Call `dynamics-gp-srv-rma-add` once with `return-document-id`, `record-type`, `customer-id`, `address-id`, `rma-type`, `rma-reason-code`, `return-status` and `site-id`.
2. Only if that succeeded, call `dynamics-gp-srv-rma-line-add` once with `return-document-id`, `line-sequence-number`, `type`, `customer-id`, `address-code`, `item-number`, `return-quantity` and `quantity` set to `{quantity}`, `unit-price`, `rma-reason-code` and `location-code`.
If the line fails after the header succeeded, tell the user an empty RMA exists under that number. Do not retry a failed write automatically. Report the error exactly as returned.
**Step 6: Verify**
Call `dynamics-gp-get-srv-rma-line` by `return-document-id` and report the stored line.
**Rules & Guidelines:**
* The only write tools this prompt may call are `dynamics-gp-srv-rma-add` and `dynamics-gp-srv-rma-line-add`, once each, after Step 4.
* Do not issue a credit; the RMA is the return authorisation only.
**Validation:**
* If `{quantity}` is not a positive number, stop and ask again.Who it's for
One answer, three teams that use it
Customer service reps
Raise a return while the customer waits
Check the sale and create the RMA in one conversation, without looking up codes or old invoices.
Create a return in Dynamics GP for Fabrikam: 2 units of SD-200, wrong item shipped.
Returns coordinators
Stop returns for items never bought
A warning appears when the customer never bought the item or is returning more than they bought.
Northwind Traders wants to return 12 CART-12 cartridges. Did they buy that many, and can you raise the RMA?
Customer support managers
Keep return codes consistent
Reusing the codes already in use keeps returns reporting clean, so reasons can be totalled later.
Raise a Dynamics GP RMA for Contoso for 1 LP-10 printer that arrived faulty, using our usual codes.
How it works
What PopdockAI does when you ask
You give the customer, item, quantity and reason, and your AI assistant checks the sale in Dynamics GP first. The RMA is created only after you approve every field, and no credit is issued.
01
Ask
You give the customer, item, quantity and reason.
02
Check
It confirms they bought the item and takes the last invoice price.
03
Confirm
You approve every field, including the return codes it reuses.
04
Create
It creates the RMA and its line and reads the line back.
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-rm-customer
microsoft-dynamics-gp-get-rm-customer-address
microsoft-dynamics-gp-get-rm-sales-line-item
microsoft-dynamics-gp-get-srv-rma
microsoft-dynamics-gp-get-srv-rma-line
microsoft-dynamics-gp-srv-rma-add
microsoft-dynamics-gp-srv-rma-line-add
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
Returns tied to a real sale at the right price
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)
