Integration developer: what you do and where
You connect another system to Earmark: an order portal or EDI hub that prices order lines, a workflow tool that approves claims, a data warehouse that reads deals, accruals and claims, or a service that reacts when something happens in Earmark. There is no Earmark role for you. Your calls run as a Finance and Operations user (the service user), and that user's roles decide what each call may do, exactly as they would for a person. Each goal below names the role the service user needs. Earmark gives you two JSON services (buildPrice and approveClaim), 39 OData entities, seven Earmark columns on the standard sales order line entity, and 26 business events. Mapping your app to a user, activating business events and turning on event publishing are done by an administrator; the goals say which role. Most Earmark pages appear only in a company where at least one Earmark module is switched on in Earmark parameters, and buildPrice refuses a sales line unless Customer deals is on there, and a purchase line unless Vendor deals is on. On a production environment whose Earmark license has reached its block date, approveClaim and new deal loads are refused (see I want to know what the license block refuses for an integration).
Set up the connection
I want to register an app and map it to a user
Your system needs an identity in Finance and Operations before it can call anything. Mapping an app to one dedicated user keeps every Earmark call traceable to that user and lets you give it exactly the access it needs.
Before you start: you can register applications in the environment's Microsoft Entra tenant, and a System administrator can add the user and the app row in Finance and Operations.
Where: the Azure portal (Microsoft Entra ID, App registrations), then System administration > Setup > Microsoft Entra ID applications in Finance and Operations.
- Register an application in the Microsoft Entra tenant of the environment and create a client secret. Copy the secret's Value, not its Secret ID.
- In Finance and Operations, open Microsoft Entra ID applications and add a row: the app's Client Id, a Name, and the User ID of a dedicated, non-interactive user.
- Set that user's default company to the legal entity you mostly call. A call that leaves
Companyblank runs there. - Get a token with the OAuth 2.0 client credentials flow for the environment URL, and send it as
Authorization: Bearer <token>on every call.
Result: the token is accepted and every call runs as the mapped user, in its default company unless the
request names Company. Earmark records that user as the one who acted (for example as the approver of a
claim it approves). Until the user holds the roles in the next goal, its calls are refused.
Needs: System administrator (to add the app row and the user). More: API reference: Authentication, Installation guide: JSON services.
I want to give the service user the roles each call needs
Earmark checks the service user's roles on the server for every call, the same way it would for a person, so the user needs the duty behind each act your integration performs, and no more.
Before you start: the app is mapped to its user (previous goal). For the conflict in step 4 to be flagged, an administrator has seeded the segregation of duties rules (once per environment).
Where: System administration > Users > Users, the service user, its roles.
- For buildPrice on sales order lines, assign Sales clerk (it holds Build line prices; so does Sales manager). For purchase order lines, assign Purchasing agent or Purchasing manager (they hold Build Earmark purchase prices). Either duty lets the user build on both kinds of line.
- For approveClaim, assign Earmark claims approver. No standard role carries Approve Earmark claims, and System administrator alone is refused.
- For OData reads and Data management loads, assign the role that grants each entity (see the goals under Read and export data and Load data).
- If one integration both prices lines and approves claims, use two apps mapped to two users: the claim approver must not be the user who generated or submitted the claim, and a seeded segregation rule flags Sales manager or Purchasing manager (both hold Unbuild line price) together with Earmark claims approver (Approve Earmark claims) on one user.
Result: each call the user's roles grant goes through. A call they do not grant is refused, either before
Earmark runs (no role grants the service operation) or by Earmark with a Blocking verdict:
MGCEarmark_Vrd_PriceBuildNotPermitted on buildPrice, MGCEarmark_Vrd_SoDClaimDenied on approveClaim
(which is what System administrator alone receives). Fix it by assigning the role, not by switching to a more
powerful identity.
Needs: System administrator. More: API reference: Security, Security reference: choosing roles and duties.
Call the JSON services
I want to build the price on an order line with buildPrice
When your order portal or EDI hub creates an order line, buildPrice prices it with the deals that apply, so the line carries the deal price and the deal money is committed, without anyone opening the price builder.
Before you start: Customer deals (for a sales line) or Vendor deals (for a purchase line) is on in Earmark parameters; the service user holds a build role (previous goal); the order is saved; nothing on the line has been reserved, picked, shipped or invoiced yet (on a purchase line: registered, arrived, received or invoiced), so call it before automatic reservation reserves the line; and the line has no current build (a line your integration created may already have been built automatically, see Lines created by your integration).
Where: POST https://<environment>/api/services/MGCEarmarkServiceGroup/MGCEarmarkBuildPriceService/buildPrice
- Read the saved line's lot ID (
InventTransId). - Send
{"_request": {...}}withLineTable(SalesLineorPurchLine),InventTransId, anIdempotencyKey(1 to 100 characters, stable for this line and this intent) and, optionally,Company. - Set
AcceptAllEligibletotrueto include every eligible deal that targets the line. Withfalseno deal is included, and the line still counts as built. - Optionally send
BasePriceSuppliedwithBasePrice, andOverBasisSuppliedwithOverBasis; otherwise the line's current unit price is the base and there is no over-basis. - Read
Builtfirst. Ontrue,UnitPrice,DealMoney,Allowance,BuildNumberandInstanceCountdescribe the build.
A repeat with the same key returns the existing build (AlreadyBuilt true) and writes nothing, so a
timeout is safe to resend. The call cannot pick deals one by one; that is done by a person in the price builder.
On a purchase line, check Headless auto-attach on purchase lines first: while it is on, Earmark builds every
new purchase line itself after save, and buildPrice is then refused with MGCEarmark_Vrd_PriceAlreadyBuilt (see
I want to know which purchase lines Earmark attaches automatically).
Result: the line's unit price is now the built UnitPrice and its amount is recalculated; on a sales line
the Earmark columns of the sales order line entity show the build. Each included deal gets one commitment on
the line (InstanceCount), which accrues when the goods move. A line price built business event follows when
event publishing is on. The commonest refusals are MGCEarmark_Vrd_PriceAlreadyBuilt (the line already has a
build: someone holding Unbuild line price unbuilds it,
then you call again with a new key) and MGCEarmark_Vrd_PriceLineOutsideEditWindow (the line has been
reserved or its goods have started to move, so it can no longer be priced). The license block never refuses
buildPrice.
Needs: a role holding Build line prices or Build Earmark purchase prices (Sales clerk, Sales manager, Purchasing agent, Purchasing manager). More: API reference: buildPrice, User guide: build a price from another system.
I want to read the verdicts a call returns
Every answer carries its policy outcomes as verdicts. Reading them is how your system knows whether the act happened and what to tell a person, without parsing message text.
Where: the Verdicts array in any answer from buildPrice or approveClaim.
- Read each verdict's
Type.Blockingmeans the act you asked for was not done;Informationalmeans the act went ahead and there is something to note. - Branch on
Id(for exampleMGCEarmark_Vrd_PriceConduitLineNotFound). It is the same in every language. - Log
Messagefor people. It is the sentence in the service user's language, as the client shows it. - Ignore the
$idmember the platform adds to every object, and tolerate members you do not model.
Result: your code reacts to stable verdict ids and shows people a sentence they can act on. A Blocking verdict is a decision, not a fault: the same request is refused the same way until its cause changes, so do not retry it in a loop.
Needs: nothing beyond the call's own role. More: API reference: the verdict object.
I want to approve a claim with approveClaim
When claims are approved in another tool, approveClaim records the decision in Earmark, so the customer credit (or, for a supplier, the accounts payable proposal) is created as if the approver had used the workflow in the client.
Before you start: the claim is Pending approval (it was submitted for approval); the service user holds Earmark claims approver and did not generate or submit the claim; on production, the license has not reached its block date.
Where: POST https://<environment>/api/services/MGCEarmarkServiceGroup/MGCEarmarkApproveClaimService/approveClaim
- Read the claim's
WorkflowInstanceIdfrom theMGCEarmarkClaimsentity. - Send
{"_request": {...}}withClaimId,WorkflowInstanceId, an optionalCommentand, optionally,Company. - Read
Approved. A BlockingMGCEarmark_Vrd_SoDClaimDeniedmeans this user may not approve this claim (its message says why: the user generated or submitted it, does not hold Approve Earmark claims, or approved a deal behind it while Block claim approval by the deal's approver is on). - On
Approvedtrue, follow the credit with the next goal.
Result: the claim reads Approved with posting status Posting pending, the service user is its
approver, and the approval credit journal is created unposted. Earmark cancels the claim's workflow instance,
so the work item leaves the assignee's list. The commonest refusals: MGCEarmark_Vrd_SoDClaimDenied (the claim
stays Pending approval for another approver; do not retry with the same identity); a re-validation verdict
such as MGCEarmark_Vrd_ClaimPeriodClosed or MGCEarmark_Vrd_ClaimLineCreditUnavailable (something the claim
relies on changed since it was submitted: the claim returns to Open, its workflow is canceled, and a person
corrects and resubmits it; the API reference lists every one); and on production
at the license block date MGCEarmark_Vrd_LicenseBlocked (nothing changes; repeat once the license is renewed).
Needs: Earmark claims approver (it also reads MGCEarmarkClaims). More:
API reference: role and segregation-of-duties re-check,
User guide: approve a claim from another system,
Approval workflows.
I want to know when an approved claim has been credited
Approval and credit are two steps: the credit is a journal that posts after the approval. Tell the customer or supplier the money is available only once it has posted.
Before you start: the claim was approved (previous goal).
Where: the Credited member of approveClaim, or PostingStatus on /data/MGCEarmarkClaims.
- Expect
Creditedfalseright after an approval: the approval credit is created unposted, and it posts later (by the accrual processor batch job when Post automatically is on for the Claim approval movement type or Auto-post claim approval journal is on, else by hand). A vendor claim's approval is an accounts payable proposal that AP posts; itsPostingStatusreads Proposed until then. - Repeat the same call to poll. A repeat answers
AlreadyApprovedtruewithCreditedas it is now, and posts nothing. - Or read the claim's
PostingStatusthrough the entity. - Do not take the Earmark claim approved business event as the credit: it is sent right after the approval decision, while the claim is still Posting pending.
Result: Credited turns true and PostingStatus reads Posted once the approval credit of every line
has posted. If an automatic post is refused, the claim stays Posting pending and a Journal post row appears
on the execution exceptions workbench for someone to fix and retry.
Needs: Earmark claims approver. More: API reference: approveClaim, Journal auto-post.
I want to tell an error from a verdict
A verdict and a malfunction need opposite responses: a verdict is a decision you act on, a malfunction is a call to resend or a fault to have fixed. Telling them apart stops your integration retrying a refusal forever or dropping a call that only failed on the way.
Where: the HTTP status and the Verdicts array.
- HTTP 200 with no Blocking verdict: the act was done, or the call was a safe repeat. Read the result.
- HTTP 200 with a Blocking verdict: a policy decision. Act on the verdict; the same request is refused the same way until the cause changes.
- HTTP 401: get a new token. HTTP 429: wait for
Retry-Afterand resend the same body. - Any other HTTP error (typically 500): the call did not complete or something malfunctioned. Both operations are idempotent, so resending the same body is safe. If approveClaim failed while creating the credit, the claim is already approved: the credit is completed with Retry selected on the Post claim approval journal row of the execution exceptions workbench, not by repeating the call.
Result: your integration acts on verdicts, resends after malfunctions, and leaves an approved claim's missing credit to the workbench. A buildPrice malfunction writes no workbench row, so log the response on your side.
Needs: nothing beyond the call's own role; Retry selected needs Accounts receivable manager, Accounts payable manager or Accounting manager. More: API reference: decisions and malfunctions, User guide: tell a verdict from a failure, Background steps and retry.
I want to know what the license block refuses for an integration
On a production environment, once Earmark's license reaches its block date, Earmark refuses the acts that start new deal money. Your integration should recognize that refusal as a decision to wait on, not as a fault.
Where: the Verdicts array, and Earmark > Setup > License status for the license state.
- Expect buildPrice to keep working: existing deals keep pricing and accruing.
- Expect approveClaim on a claim that is Pending approval to answer with a Blocking
MGCEarmark_Vrd_LicenseBlocked. The claim stays Pending approval and its workflow is untouched, so hold the request and repeat it once the license is renewed. A claim already approved still answersAlreadyApproved. - Expect a Data management import that creates a new deal through Earmark deals to fail with the same message in the job's log. Changes to existing deals are not refused, and a deal loaded through the Earmark deal migration entity is exempt from the block.
- Expect reads, exports and business events to carry on.
Result: at the block date these are verdicts, not malfunctions: HTTP 200 with a Blocking verdict, and nothing changes. On every other environment type nothing is refused. If the licensing service cannot answer, Earmark does not block. Once the license is renewed, the same requests go through.
Needs: nothing beyond each call's own role; to see the license state, License status (Earmark auditor, Accounting manager or System administrator). More: License check, API reference: decisions and malfunctions.
Read and export data
I want to find the OData collection and fields of an entity
Every Earmark entity has a stable public collection name and a natural key. Finding them first saves guessing from labels and keeps your queries working after a re-load or an upgrade.
Where: the entity reference, and
https://<environment>/data/$metadata for wire types.
- Find the entity in the summary table by its label (for example Earmark claim headers) and note its
OData entity set (
MGCEarmarkClaims). - Open its section for the primary key, every public field, which fields can be written, and which roles can read or write it.
- Read
$metadatafor the exact OData types.
Result: you know the URL to call (/data/<entity set>), the key that identifies a row, which fields you
may write, and which role to give the service user. All 39 entities are public; none is keyed on a record ID.
Needs: no role to read the reference. More: Entity reference: using these entities.
I want to read deals
A data warehouse or CRM that reports on trade spend needs the deals themselves: their terms, what they target, how they are funded and how much they have used.
Where: GET https://<environment>/data/MGCEarmarkDeals (also MGCEarmarkDealTargets,
MGCEarmarkDealFundingRules, MGCEarmarkDealBalances).
- Filter with
$filter(the key isDealId). - Read the targets, funding rules and balances by the same
DealId. - Add
?cross-company=trueand filter ondataAreaIdto read another legal entity; otherwise the service user's default company is read.
Result: each deal comes back under its DealId, so rows join across the four collections and the key
survives an export and re-load. Each row names its company in dataAreaId.
Needs: read: any role that holds Inquire into Earmark, which is every Earmark role and every standard role Earmark extends except Customer service representative, Purchasing agent and System administrator (System administrator reads every entity anyway); for example Earmark auditor, Sales clerk, Sales manager, Accountant or Accounts receivable clerk. More: Entity reference: Earmark deals.
I want to read accruals
Accrued deal money is a liability in your books. Reading the movements lets a warehouse or planning tool report what has accrued, reversed and been claimed per deal and per order line.
Where: GET https://<environment>/data/MGCEarmarkAccrualTransactions (movements) and
/data/MGCEarmarkAccrualInstances (commitments); also /data/MGCEarmarkAccrualJournalRegisters for the
journals Earmark created.
- Read the transactions for movement type, amounts and posting status.
- Read
DealId,InventTransIdandReferenceIdon the same rows for the deal and the order line the movement belongs to; no join to the instances is needed. - Read the posting status: Journal pending means the movement's Earmark journal has not posted yet, Posted means it has.
Result: you can total accruals per deal, customer or order line straight from the movements. A movement appears when the accrual processor batch job handles the posted document, not at the moment the document posts, so a shipment posted a moment ago may not show yet.
Needs: read: any role that holds Inquire into Earmark accruals: Accountant, Accounting manager, Accounting supervisor, Earmark auditor, Earmark claims approver, Earmark deal approver, Inventory accountant, Sales clerk, Purchasing agent, Purchasing manager, Accounts receivable clerk or manager, or Accounts payable clerk or manager. More: Entity reference: Earmark accrual transactions, Accrual event processing.
I want to read or export claims
Claims are deal money turned into credits. Reading them lets your system tell a customer or supplier what was claimed, approved and credited.
Where: GET https://<environment>/data/MGCEarmarkClaims and /data/MGCEarmarkClaimLines; also
MGCEarmarkClaimAgings, MGCEarmarkClaimsAvailableByCustomers and MGCEarmarkClaimStatementLines.
- Read the header for
Status,PostingStatusandWorkflowInstanceId. - Read the lines by
ClaimIdandLineNum.ClaimReferenceis the reference quoted to the counterparty. - A claim line carries no remaining amount. For unapplied customer credit per invoice account and currency,
read
AvailableBalanceonMGCEarmarkClaimsAvailableByCustomers. No entity gives the remaining amount per line or for vendor credits.
Result: Status tells you where each claim is (for example Pending approval or Approved) and
PostingStatus whether its credit has posted; the lines give the amounts and references to quote.
Needs: read: Earmark auditor, Earmark claims approver, Sales clerk, Sales manager, Accounts receivable clerk or manager, Accounts payable clerk or manager, or Accounting supervisor. More: Entity reference: Earmark claim headers.
I want to read the Earmark price on a sales order line
An order portal or CRM that shows the order needs the deal price split: base, deal money and allowance, and whether the line has been priced at all.
Where: GET https://<environment>/data/SalesOrderLines (the standard Sales order lines V2 entity).
- Select the Earmark columns:
MGCEarmarkBasePrice,MGCEarmarkOverBasis,MGCEarmarkDealMoney,MGCEarmarkAllowance,MGCEarmarkPriceMode,MGCEarmarkBuildState,MGCEarmarkBuildNumber. - Read them as the line's current build. A line with no build returns them empty; every line is still returned.
- The columns are read-only. To build a price, call buildPrice.
Result: each line shows its current build, and MGCEarmarkBuildState reads Built, Stale or
Unbuilt. Only the V2 entity carries these columns: Sales order lines V3 (SalesOrderLinesV3) and the
purchase order line entities have none.
Needs: the standard entity's own security (for example Sales clerk); Earmark adds no privilege. More: Entity reference: SalesOrderLineV2Entity.
Load data
I want to load deals and setup through Data management
When you start with Earmark, or bring deals in from a planning tool, a Data management import creates many deals and their setup at once instead of keying them.
Before you start: the customers, vendors, items and units the deals name exist in the company; on production, the license has not reached its block date (new deals are refused then).
Where: System administration > Workspaces > Data management.
- Create an import project and add the entity by its label (for example Earmark deals, then Earmark deal targeting and Earmark deal funding rule).
- Give every deal its
DealIdand a deal unit (DealUnit): the import draws no deal ID from a number sequence, and a deal without either is refused. - Load deals in Planning. A deal in any other status is refused; approval goes through the workflow.
- Run the import.
Deals already approved in a legacy system are loaded at cut-over through the migration entities, in an import project that stages the data (a row written through OData or with Skip staging is never counted as migrated), not here (see Implementation consultant: load deals and claims already in force and the story Moving running trade deals into Earmark in the middle of the year). Their targeting, funding rules and deal postings then load through the entities above, by a user who also holds the Migrate Earmark deals and claims without approval workflow duty (on no role as shipped).
Result: each deal is created in Planning with its targets and funding rules, ready for a deal manager to submit for approval. A row the Earmark table refuses fails with that table's message in the job's log.
Needs: a Data management role (for example Data management administrator), plus the role that may write the entity: Sales manager, Purchasing manager or Inventory accountant for deals, targets, funding rules and deal postings; Accounting manager for setup entities (parameters, deal groups, posting profiles, posting control, dimension rules, inbound pricing policies, reason applicability). More: Entity reference: Earmark deals, Entity reference: migration and cut-over entities.
I want to export Earmark data on a schedule
A warehouse or reconciliation that needs Earmark data every night can take it as a recurring Data management export, with no custom code.
Where: System administration > Workspaces > Data management.
- Create an export project and add the entities you need. Every Earmark entity is enabled for Data management, read-only ones included.
- Schedule it as a recurring export, as for any entity.
Result: each run exports the current rows of the entities in the project, like any other Data management export. Earmark adds nothing of its own to the schedule.
Needs: a Data management role, plus a role that reads each entity (Earmark auditor reads all of them except the four migration entities and the control verdict entity). More: Installation guide: data entities.
React to events
I want to subscribe to Earmark business events
Business events let your system react when something happens in Earmark (a deal approved, a price built, a claim generated) instead of polling for it.
Before you start: the endpoint your system listens on exists (for example an Azure Service Bus queue).
Where: System administration > Setup > Business events > Business events catalog.
- After each install or upgrade, select Rebuild business event catalog.
- On the Endpoints tab, set up the endpoint your system listens on.
- On the Business event catalog tab, find the Earmark events (their business event IDs start with
MGCEarmark; see the table below), select Download schema for the payload, and select Activate for the legal entities you need.
| Area | Business events (name in the catalog) |
|---|---|
| Deals | Earmark deal submitted, approved, returned, amended, canceled, aborted, closed |
| Price build-up | Earmark line price built, Earmark line price unbuilt, Earmark line price flagged stale |
| Accruals | Earmark accrual accrued, Earmark accrual reversed, Earmark accrual returned |
| Claims | Earmark claim generated, approved, adjusted, reversed; Earmark claim settlement preference recorded; Earmark claim statement run |
| Vendor deals | Earmark mirror paired, Earmark mirror condition changed, Earmark third-party settled, Earmark vendor settlement run completed |
| Platform | Earmark execution exception created, License state changed, Migration batch certified |
Result: the activated events are sent to your endpoint when they happen in those legal entities, provided Earmark publishes their family (next goal).
Needs: Business events security role (Microsoft) or System administrator. More: Installation guide: business events, Business events.
I want to make Earmark publish the events I subscribed to
Activating an event in the catalog is not enough: Earmark sends each family of events only while its switch in Earmark parameters is on, so a subscription can stay silent.
Before you start: the events are activated in the catalog (previous goal).
Where: Earmark > Setup > Earmark parameters, Events tab.
- Check Publish deal events (on at install). It governs 17 of the 26 events: the deal events and also the price build-up, vendor deal, execution exception, license and migration events.
- Check Publish accrual events (on at install) for the three accrual events.
- Turn on Publish Earmark claim events if you need the six claim events. It is off at install, so no claim event is sent until it is on.
Result: events in each family that is switched on are sent when they happen. If a send fails, an Event publish row appears on the execution exceptions workbench. Retry selected re-sends only a deal event's row (do not rely on it for any other event), and while the family's switch is off it resolves the row and sends nothing.
Needs: Accounting manager or System administrator. More: Page reference: Earmark parameters, Business events, Configuration reference.
Lines created by your integration
I want to know which sales lines Earmark prices automatically
If your integration creates sales order lines, Earmark can price them itself just after the order is saved. Knowing which lines it takes tells you when to call buildPrice yourself and when a second build would be refused.
Before you start: Customer deals and Inbound auto-pricing are on in Earmark parameters (see the next goal).
Where: Earmark > Setup > Inbound pricing policies (the policy for each customer and sales origin).
- Know which lines count: only lines created by the standard sales order line data entities (OData, Data management, dual-write, Dynamics 365 Sales). Inbound auto-pricing is off at install; while it is off, no line is priced automatically whatever the policies say. Price build-up on sales lines does not need to be on.
- Know which never count: lines entered in the order form or by Copy from, return and credit note lines, lines with a negative quantity, intercompany orders, Commerce orders, and lines inserted by custom code, EDI or the older V1 sales order line entity.
- Read the matching policy's action: Do nothing (the default), Propose and hold, or Build and accept all eligible. It is applied just after the order is saved. Propose and hold records the eligible deals as a proposal and changes no price; nothing picks that proposal up later, so treat the line as unpriced.
- To price any other line yourself, call buildPrice instead.
Result: a line a Build and accept all eligible policy takes is built with every eligible deal a moment
after the save, and its Earmark columns show the build; buildPrice on it is refused with
MGCEarmark_Vrd_PriceAlreadyBuilt. A build that is refused, or fails with an Earmark error, leaves the line
unpriced with no workbench row; only some failures raise an Inbound price build row.
Needs: read the policies: Accounting manager on the page (it maintains them); through the
MGCEarmarkInboundPricingPolicies entity also Sales clerk, Sales manager, Customer service representative,
Accounts receivable clerk, Earmark auditor or Earmark deal approver. More:
User guide: lines created by an integration,
Page reference: Inbound pricing policies,
Inbound order line pricing.
I want to turn on automatic pricing of integration lines
Automatic pricing is off at install, so integration lines stay unpriced until you switch it on and say, per customer and sales origin, what Earmark should do with them.
Before you start: you know which policy action each customer and sales origin needs (previous goal).
Where: Earmark > Setup > Earmark parameters, Price build-up tab.
- Check that Customer deals is on (Modules tab).
- On the Price build-up tab, turn on Inbound auto-pricing.
- Add the policies on Earmark > Setup > Inbound pricing policies. A line no policy matches is left alone (Do nothing).
The switch is off at install. If you set up policies on an earlier release, which did not read the switch, they price nothing after the update until it is on. While it is off, Retry selected on an Inbound price build row does not retry it: the row stays Open and a warning names the order and line.
Result: integration lines saved from then on are handled by their policy. Lines saved while the switch was off are not priced afterwards; call buildPrice for them.
Needs: Accounting manager or System administrator for the parameters; Accounting manager for the policies. More: Page reference: Earmark parameters, User guide: lines created by an integration, Inbound order line pricing, Configuration reference.
I want to know which purchase lines Earmark attaches automatically
If your integration creates purchase order lines, Earmark can attach the supplier deals that apply as soon as each line is saved, so supplier rebates accrue on lines nobody prices by hand. Knowing this keeps you from building those lines a second time.
Before you start: Vendor deals is on (Modules tab of Earmark parameters).
Where: Earmark > Setup > Earmark parameters, Vendor deals tab, Headless auto-attach on purchase lines (off as shipped).
- Check the switch. While it is on, Earmark builds the price of every new purchase line with every vendor deal that applies, just after the line is saved. Lines a buyer enters and lines your integration creates are both included.
- Know which lines are left alone: return lines, lines with a negative quantity, and intercompany or return orders.
- Do not also call buildPrice for those lines: they are already built, and the call is refused with
MGCEarmark_Vrd_PriceAlreadyBuilt.
Result: each new purchase line in scope carries its build a moment after the save, and the purchase order is never refused because of it. A build that is refused, or fails with an Earmark error, leaves the line unpriced with no workbench row; only some failures raise a Headless purchase attach row on Earmark > Inquiries and reports > Earmark execution exceptions.
Needs: Accounting manager or System administrator to read or change the parameter. More: Page reference: Earmark parameters, Page reference: Earmark execution exceptions, Inbound order line pricing.
I want to find automatic builds that failed
An automatic build never stops the order, so a failure is easy to miss. Finding it lets you price the line before the goods move and the line can no longer be priced.
Where: Earmark > Inquiries and reports > Earmark execution exceptions (also
/data/MGCEarmarkExecutionExceptions).
- Filter on the operation Inbound price build (sales lines) or Headless purchase attach (purchase lines), and note each row's Company.
- Read the row's Message for the cause and fix it.
- Ask someone who holds Retry selected to switch to the row's company first, then retry it: a retry runs in the current company, and from another company it finds no line and marks the row Resolved. For a sales line, check that Inbound auto-pricing is still on: while it is off the retry is refused with a warning and the row stays Open.
- Remember that the workbench does not list every line left unpriced: a refused build raises no row. For
sales lines you expected to be priced, read
SalesOrderLinesfor an emptyMGCEarmarkBuildNumberand price them with buildPrice.
Result: a successful retry marks the row Resolved and the line carries its build. A retry does not change the row's Message, and Resolved also follows a retry that found no line, so check the line itself.
Needs: read: any role that holds Inquire into Earmark (every Earmark role and every standard role Earmark extends except Customer service representative, Purchasing agent and System administrator, which reads everything anyway); Retry selected: Accounts receivable manager, Accounts payable manager or Accounting manager. More: User guide: work the execution exceptions workbench, Page reference: Earmark execution exceptions, Background steps and retry.