MGCLatticeSalesOrderCaptureService
Custom service for CAPTURING (creating) sales orders. Unlike MGCLatticeSalesOrderPostingService (which only confirms/packs/invoices EXISTING orders), this service creates a brand new sales order header and its lines from a typed request contract via the AxSalesTable / AxSalesLine business-document framework, so the order is defaulted and validated the standard way. It is the order-CAPTURE surface for the O2C intake-accelerator bundle. Idempotent by RequestId via the shared base lifecycle.
Methods
new
Initializes a new instance of the MGCLatticeSalesOrderCaptureService class.
- Visibility:
public - Returns:
void
No parameters.
construct
Creates a new instance of the MGCLatticeSalesOrderCaptureService class.
- Visibility:
public - Returns:
MGCLatticeSalesOrderCaptureServiceA new MGCLatticeSalesOrderCaptureService instance.
No parameters.
resolveLineInventDimId
Resolves the inventory dimension id for a capture line: a caller-supplied InventDimId takes precedence; otherwise a dimension is found-or-created from the line's site/warehouse. Returns an empty id when the line specifies none (AxSalesLine then defaults the dimension from the item).
- Visibility:
protected - Returns:
InventDimIdThe resolved InventDimId, or an empty string when none was specified.
| Name | Type | Optional | Description |
|---|---|---|---|
_lineContract | MGCLatticeSalesOrderCaptureLineContract | No | The capture line contract carrying InventDimId or Site/Warehouse. |
createSalesOrder
Creates a sales order (SalesType::Sales) for a customer with one or more lines, via the AxSalesTable / AxSalesLine business-document framework so the header and lines are defaulted and validated the standard way (NOT raw table inserts). Optionally honors a caller-supplied SalesOrderId and order currency. Each line supplies ItemId, Qty (required; a line without a quantity is refused), and optionally UnitId, UnitPrice, and a site/warehouse (or a pre-resolved InventDimId). The created order number is returned as DocumentId and PostedDocumentId. Idempotent by RequestId: a duplicate replays the original created order and never creates a second order. The operation has no preview: PreviewMode set is refused.
- Visibility:
public - Returns:
MGCLatticeOrderOperationResponseContractAn MGCLatticeOrderOperationResponseContract carrying the created SalesId, or a failure.
| Name | Type | Optional | Description |
|---|---|---|---|
_request | MGCLatticeCreateSalesOrderRequestContract | No | Request with CustAccount, optional CurrencyCode/SalesOrderId, and the order lines. |
createSalesOrderBatch
Creates multiple sales orders in a single bulk operation. Each element is processed independently through createSalesOrder (its own idempotency claim), and per-item results are aggregated. A missing (null) item fails on its own as ValidationFailed (addBulkNullItemResult) without stopping the batch.
- Visibility:
public - Returns:
MGCLatticeBulkOperationResponseContractAn MGCLatticeBulkOperationResponseContract containing per-item results.
| Name | Type | Optional | Description |
|---|---|---|---|
_requests | List | No | List of MGCLatticeCreateSalesOrderRequestContract. |