Preview entity action
preview_entity_actionPreview a weclapp workflow ACTION on one entity; return an approval token.
purchaseOrder.confirm: guarded draft to CONFIRMED, no receipt or supplier-confirmation proof. Generic actions: get_schema(entity).entity_actions. Domain actions (payload schema: get_entity_action_catalog(entity, action)): salesOrder createShipment|createSalesInvoice|cancel; quotation accept|createSalesInvoice|cancel; purchaseOrder bookIncomingGoods|cancel; incomingGoods bookReceipt; salesInvoice|purchaseInvoice cancel (status OPEN_ITEM_CREATED); purchaseInvoice correct (any field fix); shipment cancel (voids)|rework (status back to NEW); quotation|salesOrder|salesInvoice|shipment|performanceRecord createPdf; purchaseOpenItem|salesOpenItem createPaymentApplication|setPaymentState (payment_state PAID|UNPAID).
Args: entity: the record's entity (e.g. salesOrder, ticket). action: a generic or domain action (see above). entity_id: the numeric record id; omit it for incomingGoods.bookReceipt and when a payload number names the order. payload: action fields; most generic actions take none ({}). createShipment: {"sales_order_number": "...", "items": [{"positionNumber": 2, "quantity": 2}]}; bookIncomingGoods: same with purchase_order_number; setPaymentState: {"payment_state": "PAID"}. purchaseOrder.confirm accepts allow_automated_confirmation_email only after consent to supplier-email rules. ticket.linkSalesOrder requires salesOrderId. Unknown keys are dropped (dropped_fields); domain actions reject them. Returns: approval + execution, or ready_for_* false with diagnostics. when_to_use: First step of a workflow or domain action. purchaseOrder.manuallyClose requires CONFIRMED; createIncomingGoods is refused (bare scaffold) — book via purchaseOrder.bookIncomingGoods. preconditions: Live status and received/shipped/invoiced guards; processed records get no token. post_effects: No mutation; after the user explicitly confirms, execute_approved.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | ||
| entity | Yes | ||
| payload | No | ||
| entity_id | No | ||
| correlation_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||