iVendNextDevelopers Request a sandbox

Workflow

The approval states of a record type and who may move a record between them. A manifest can install one.

Area: The retailer's setup · Why it is here: · Fields: 9

iVendNext's own description: Defines workflow states and rules for a document.

Read and write it

Every call runs as your app's own user, with its key in one header, at the retailer's own address. The user reads and writes only what its role allows: your app's user, and the rights the retailer gives it.

Read a list (only name unless you ask for fields):

curl -s "https://⟨site⟩/api/resource/Workflow?fields=%5B%22*%22%5D&limit_page_length=20" \
  -H "Authorization: token ⟨api key⟩:⟨api secret⟩"

Read one, with its tables:

curl -s "https://⟨site⟩/api/resource/Workflow/⟨name⟩" -H "Authorization: token ⟨api key⟩:⟨api secret⟩"

Create one (the required fields first), if your app's role may:

curl -s -X POST "https://⟨site⟩/api/resource/Workflow" -H "Authorization: token ⟨api key⟩:⟨api secret⟩" \
  -H "Content-Type: application/json" -d '{"workflow_name": …, "document_type": …, "workflow_state_field": …}'

Change one with PUT /api/resource/Workflow/⟨name⟩ and the fields you change; a table sent there replaces its rows, so send its existing rows too. All the record calls and their answers: the API reference.

Samples that use it

s22_customer_loyalty

Fields

Read from the product at POS 2.1.0.667 (till app 60147699c): its own fields, the fields iVendNext adds to it, and iVendNext's changes to any of them. Read-only fields are set by iVendNext; a hidden one is not on the form but can be read. Every record also has name (its id, in the address), owner, creation, modified, modified_by and docstatus (0 a draft, 1 submitted, 2 cancelled), all read-only.

Field Field name Type Required Read-only Hidden Links to
Workflow Name workflow_name Data yes
Document Type document_type Link yes DocType
Is Active is_active Check
Don't Override Status override_status Check
Send Email Alert send_email_alert Check
Document States states Table Workflow Document State
Transitions transitions Table Workflow Transition
Workflow State Field workflow_state_field Data yes
Workflow Data workflow_data JSON yes

Table: Workflow Document State

The rows of states. Each row also has idx (its place), parent, parentfield and parenttype.

Field Field name Type Required Read-only Hidden Links to
State state Link yes Workflow State
Doc Status doc_status Select one of: 0, 1, 2
Update Field update_field Select
Update Value update_value Data
Is Optional State is_optional_state Check
Don't Override Status avoid_status_override Check
Next Action Email Template next_action_email_template Link Email Template
Only Allow Edit For allow_edit Link yes Role
Message message Text
Workflow Builder ID workflow_builder_id Data yes

Table: Workflow Transition

The rows of transitions. Each row also has idx (its place), parent, parentfield and parenttype.

Field Field name Type Required Read-only Hidden Links to
State state Link yes Workflow State
Action action Link yes Workflow Action Master
Next State next_state Link yes Workflow State
Allowed allowed Link yes Role
Allow Self Approval allow_self_approval Check
Condition condition Code
Workflow Builder ID workflow_builder_id Data yes

All record types · What you can use

This record type in the kit