Author:
Fluent Commerce staff
Changed on:
5 Apr 2024
The RULE SDK package contains a rule:
`DemoAddAttributeToOrder`
Alternatively, feel free to create your own rule to fir your purpose.
In this example, a CC Order workflow will be used:
1 {
2 "name": "SendCanceltoWMS",
3 "type": "ORDER",
4 "subtype": "CC",
5 "eventType": "NORMAL",
6 "rules": [
7 {
8 "name": "<AccountId>.<PackageName>.DemoAddAttributeToOrder",
9 "props": {
10 "name": "SENT_TO_WMS",
11 "type": "String",
12 "value": "true"
13 }
14 }
15 ],
16 "triggers": [
17 {
18 "status": "BOOKED"
19 }
20 ],
21 "userActions": [
22 {
23 "context": [
24 {
25 "label": "SendCanceltoWMS",
26 "type": "PRIMARY",
27 "modules": ["adminconsole"],
28 "confirm": false
29 }
30 ],
31 "attributes": []
32 }
33 ]
34 },
Language: json
Name: SendCanceltoWMS ruleset
Description:
[Warning: empty required content area]1 "actions": {
2 "primary": [
3
4 {
5 "type": "userAction",
6 "label": "SEND CANCEL TO WMS",
7 "name": "SendCanceltoWMS",
8 "condition": "{{ne orderById.attributes.byName.SENT_TO_WMS 'true'}}"
9 },
10
Language: json
Name: userAction manifest snippet
Description:
This code will be utilising the
`condition`
"condition": "{{ne orderById.attributes.byName.SENT_TO_WMS 'true'}}"
The User action button will be displayed if the order attribute's SENT_TO_WMS value is not True:
Otherwise, the button will not be displayed:
Copyright © 2024 Fluent Retail Pty Ltd (trading as Fluent Commerce). All rights reserved. No materials on this docs.fluentcommerce.com site may be used in any way and/or for any purpose without prior written authorisation from Fluent Commerce. Current customers and partners shall use these materials strictly in accordance with the terms and conditions of their written agreements with Fluent Commerce or its affiliates.