Skip to content
Developerhome
Sage Distribution and Manufacturing Operations

Mutation: Active range

  Less than to read

Since version 55 of Sage Distribution and Manufacturing Operations (SDMO), the structure of resources (machine resources, group resources, tool resources, labor resources) has changed.

Now, the field activeRange is responsible for handling the definition of the activity start and end date.

The field activeRange replaces the two date fields activeFrom and activeTo, previously responsible for handling the definition of the activity start and end date.

The substitution of the fields activeFrom and activeTo by the activeRange field occurred as a single date range type field is more efficient for database management.

The following table displays an example and the result of a mutation using activeRange. Some of the fields shown are not mandatory and others have been omitted.

mutation
{
  xtremMasterData {
    groupResource {
        update (
            data: {
                _id: "78512",
                activeRange: "(2023-01-01, 2025-01-02)"
            }
        ) {
            activeRange
        }
    }
  }
}
{
    "data": {
        "xtremMasterData": {
            "groupResource": {
                "update": {
                    "activeRange": "(2023-01-01, 2025-01-02)"
                }
            }
        }
    },
    "extensions": {
        "diagnoses: []
    }
}

A mutation that tries to update the activeFrom and activeTo fields results in an error.

The following table displays an example of a mutation using the activeFrom and activeTo and the respective error messages.

mutation
{
    xtremMasterData {
        groupResource {
            update (
                data: {
                    _id: "78512",
                    activeFrom: "2023-01-02"
                    activeTo: "2025-01-02"
                }
            ) {
                activeRange
            }
        }
    }
}
{
    "errors": [
        {
            "message": "Field activeFrom is not defined by type GroupResource_Input. Did you mean activeRange?",
            "locations": [
                {
                    "line": 7,
                    "column": 13
                }
            ]
        },
        {
            "message": "Field activeTo is not defined by type GroupResource_Input. Did you mean isActive?",
            "locations": [
                {
                    "line": 8,
                    "column": 13
                }
            ]
        }
    ]
}

Note: In some cases, the activeFrom and activeTo fields still exist as computed properties. The example below is one of such cases:

mutation
{
  xtremMasterData {
    groupResource {
      query {
        edges {
          node {
            id
            activeFrom
            activeTo
            activeRange
          }
        }
      }
    }
  }
}