Skip to content
Developerhome
Sage Distribution and Manufacturing Operations

Order By

  Less than to read

You can apply OrderBy to custom fields.

The following table displays an example of how OrderBy is applied to a custom field. Some of the fields displayed are not mandatory and others have been omitted.

{ 
  xtremMasterData { 
    item { 
      query( 
        filter: "{\"_customData\":{\"marketingDate\":{\"_eq\":\"2023-08-17\"}}}" 
        orderBy: "{\"_customData\":{\"rating\":-1}}", 
        first: 30 
      ) { 
        edges { 
          node { 
            id 
            _customData 
          } 
        } 
      } 
    } 
  } 
}   
{ 
  "data": { 
    "xtremMasterData": { 
      "item": { 
        "query": { 
          "edges": [ 
            { 
              "node": { 
                "id": "011000", 
                "_customData": "{\"rating\":54,\"marketingDate\":\"2023-08-17\"}" 
              } 
            }, 
            { 
              "node": { 
                "id": "PIE_BLUEBERRY", 
                "_customData": "{\"rating\":28,\"marketingDate\":\"2023-08-17\"}" 
              } 
            } 
          ] 
        } 
      } 
    } 
  }
}