---
sourceDocument: Australia API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/api-reference

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# OrderUtil - Scoped

# OrderUtil - Scoped {#ariaid-title1}

Release version: Australia  
Updated March 12, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read  
The OrderUtil script include enables you to view and retrieve order details.

To access the methods in this script include, use the `sn_ind_tmt_orm` namespace identifier. The Order Management (com.sn_ind_tmt_orm) plugin is required to access the OrderUtil script include.

## OrderUtil - OrderUtil() {#ariaid-title2}

Creates an instance of the OrderUtil class.
{#OU-OrderUtil__table_bbt_ccc_5bb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 1. Parameters]

{#OU-OrderUtil__table_bbt_ccc_5bb}  
The following example shows how to instantiate an OrderUtil object called myOrder.

    var myOrder = new sn_ind_tmt_orm.OrderUtil();

## OrderUtil - getStateFromOrder(String orderSysId) {#ariaid-title3}

Gets the state of a specified order.
{#OU-getStateFromOrder_S__table_scg_csh_b2c__entry__3}

| Name | Type | Description |
|-|-|-|
| orderSysId | String | The sys_id of the order located in the Customer Order \[sn_ind_tmt_orm_order\] table. |
[Table 2. Parameters]

{#OU-getStateFromOrder_S__table_scg_csh_b2c} {#OU-getStateFromOrder_S__table_tcg_csh_b2c__entry__2}

| Type | Description |
|-|-|
| String | Returns the state value from the order record. If there's an issue with getting the order record or there's no order sys_id passed, then the method returns null. |
[Table 3. Returns]

{#OU-getStateFromOrder_S__table_tcg_csh_b2c}  
The following example shows how to get the state value of a specified order.

    var orderId = "<order_sys_id>"; // order sys_id, with state draft
    var state = new sn_ind_tmt_orm.OrderUtil().getStateFromOrder(orderId);
    gs.info(state);

Output:

    draft

## OrderUtil - isOrderInDraftState(String orderSysId) {#ariaid-title4}

Returns whether the state of a specified order is in draft state.
{#OU-isOrderInDraftState_S__table_scg_csh_b2c__entry__3}

| Name | Type | Description |
|-|-|-|
| orderSysId | String | The sys_id of the order located in the Customer Order \[sn_ind_tmt_orm_order\] table. |
[Table 4. Parameters]

{#OU-isOrderInDraftState_S__table_scg_csh_b2c} {#OU-isOrderInDraftState_S__table_tcg_csh_b2c__entry__2}

| Type | Description |
|-|-|
| Boolean | Flag that indicates whether the state of a specified order is in draft state. Valid values: * true: The specified order is in draft state. * false: The specified order is either not in draft state, there's an issue retrieving the order record, or no sys_id was passed. {#OU-isOrderInDraftState_S__ul_fct_mth_b2c} |
[Table 5. Returns]

{#OU-isOrderInDraftState_S__table_tcg_csh_b2c}  
The following example shows how to determine a specified order is in draft state.

    var orderId = "<order_sys_id>"; // order sys_id, with state draft
    var state = new sn_ind_tmt_orm.OrderUtil().isOrderInDraftState(orderId);
    gs.info(state);

Output:

    true


