Reassign to group
open

By yann shukor, 2 years ago

Hi

Thanks you for this wonderful "Swiss knife" module

I previously created a query which is working perfectly

though I have to admit that I'm still feeling my way 

around. 

I'm not quite sure how to formulate an action i.e. I'm

not sure whether, or how, to use bind_value or constant_

value.

I have an issue that my developer hasn't been able to 

resolve yet. For some unexplainable reason a client 

loses his group membership; and hence can't pass any

more orders.

I came up with the idea of temporarily remedying the situation 

using Consequences. Every time the client is deassigned

from the group, I simply reassign him to it

T) the rule is executed after a record update

C) as long as the "customer_id=186" and the "group_id !=8".

A) assign group_id=8 for this customer

Since I am not obtaining the expected result, I'm wondering 

whether my rule is correct ?

Would you mind taking a peek and letting me know what 

I may have done wrong ?

Regards

yann shukor

json file:

{
  "code": "38fde3680e19904042e2369a01115b82.package1665432724",
  "minVersion": "0.7.1",
  "name": "Reassign Siemens LU (186) to group : Intracommunautaire (8)",
  "description": "Exported rule",
  "content": [
    {
      "type": "rule",
      "name": "Reassign Siemens LU (186) to group : Intracommunautaire (8)",
      "rule": {
        "trigger": "afterRecordUpdated",
        "triggerSettings": {
          "recordType": "Group"
        },
        "action": "setCustomerGroup",
        "actionSettings": {},
        "bindings": {
          "params.customer": {
            "method": "input",
            "value": "context.customer.id"
          },
          "params.group": {
            "method": "constant",
            "value": "8"
          }
        },
        "conditions": [
          [
            {
              "condition": "equals",
              "not": true,
              "key": "group.id",
              "arguments": [
                8
              ]
            },
            {
              "condition": "equals",
              "not": false,
              "key": "context.customer.id",
              "arguments": [
                186
              ]
            }
          ]
        ]
      }