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

 Release :

    - australia

ft:locale :

    - de-DE

ft:publication_title :

    - Australia API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# IBQConfigBase API - Scoped

# IBQConfigBase API - Scoped {#ariaid-title1}

* Freigeben Version: Australia
* 
* Aktualisiert 12. März 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 17 Minuten Lesedauer

Script include that must be extended for Sales and Order Management Request Tracker to track the requests. This script include provides overridable methods that define how requests should be executed.

The Sales and Service API Core (com.sn_tmt_core) plugin must be activated for IBQConfigBase script include to be available in an instance. This script include belongs to the `sn_tmt_core`
namespace and requires the admin role.  
See also:

* [Lead to Cash Core](https://www.servicenow.com/docs/access?context=lead-to-cash&version=australia&pubname=australia-order-management&ft:locale=en-US)
* [Inbound Request](https://www.servicenow.com/docs/access?context=som_request_tracker&version=australia&pubname=australia-order-management&ft:locale=en-US)
{#IBQConfigBaseAPIBoth__ul_o13_lls_1fc}

## Extending the IBQConfigBase API {#IBQConfigBaseAPIBoth__section_pb4_v2w_bfc}

Define a script include with the overridable methods of the IBQConfigBase API.  
1. Create a script include. The name must start with <kbd class="ph userinput">IBQConfig</kbd>, for example, IBQConfigQuoteToOrderFlowSNC.
2. Extend the IBQConfigBase API.  
   For example:

       IBQConfigQuoteToOrderFlowSNC.prototype = Object.extendsObject(sn_tmt_core.IBQConfigBase, { 
       ...
       });

3. Override any necessary methods provided by the IBQConfigBase API.  
   For example:

       getRunMode: function(inboundQueueParams) {
           return this.quoteUtil.getQuoteSize(inboundQueueParams.source_record_ids, this.threshold);
       },

       generateParentRecord: function(inboundQueueParams, additionalParams, context) {
           var result = "";
           var entityMappingGr = this.getMapingConfigIdFromSysId(inboundQueueParams.requested_flow);
           var sourceToTargetConfigID = entityMappingGr.getValue("mapping_config_id");
           var sourceHeaderId = inboundQueueParams.source_record_ids;
           if (gs.nil(inboundQueueParams.requested_flow))
               throw "sourceToTargetConfigID cannot be null";
           if (gs.nil(inboundQueueParams.source_record_ids))
               throw "source record id cannot be null";
           var util = new sn_l2c_core.PrimitiveUtil();
           if (gs.nil(additionalParams))
               additionalParams = {};
           additionalParams[this.SKIP_LINES_KEY] = "true";
       },

       processInboundQueueRequest: function(inboundQueueGR) {
           gs.info("processRequest inboundQueueGR " + JSON.stringify(inboundQueueGR));
           var result = this.quoteUtil.createOrderFromQuoteUsingMetadata(inboundQueueGR.getValue('source_record_ids'), 'sn_l2c_quote_to_order', null, null, inboundQueueGR.getValue('record_id'));
           return result;
       }

4. Create a new metadata entry in Inbound Request Configuration \[sn_tmt_core_inbound_queue_config\] table to define how a request should be processed.
5. Link the script include created to the configuration_api field of metadata record to use the custom logic defined while processing the request. The script include is referenced in the configuration_api field while creating Inbound Request Configuration metadata.
{#IBQConfigBaseAPIBoth__ol_k4y_3k1_bfc}

## Use case: IBQConfigQuoteToOrderFlow {#IBQConfigBaseAPIBoth__section_adb_nk1_bfc}

You can use the IBQConfigBase API to create an order from a quote using inbound request configuration metadata. IBQConfigQuoteToOrderFlow is a custom script include that can be created by extending the IBQConfigBase API. The logic for the overridable methods must be added in the IBQConfigQuoteToOrderFlow script include.  
Hinweis:  
This script include extends the IBQConfigBase API and is used in the method examples. For information on using the PrimitiveUtil API, refer to [LeadtoCashCore - Scoped](https://servicenow-prod.fluidtopics.net/2N2YrqoO092vGEYqBEPtJA#LeadToCashCoreAPI "The LeadtoCashCore script include provides methods to orchestrate a lead-to-cash workflow in the Lead to Cash Core life cycle.").

    var IBQConfigQuoteToOrderFlowSNC = Class.create();
    IBQConfigQuoteToOrderFlowSNC.prototype = Object.extendsObject(sn_tmt_core.IBQConfigBase, {

        initialize: function() {
    		this.quoteUtil = new sn_quote_mgmt.OrderIntegration();
            this.SKIP_LINES_KEY = "skipLines";
    		this.threshold = 15;
        },

        getRunMode: function(inboundQueueParams) {
            return this.quoteUtil.getQuoteSize(inboundQueueParams.source_record_ids, this.threshold);
        },


        generateParentRecord: function(inboundQueueParams, additionalParams, context) {
            var result = "";
            var entityMappingGr = this.getMapingConfigIdFromSysId(inboundQueueParams.requested_flow);
            var sourceToTargetConfigID = entityMappingGr.getValue("mapping_config_id");
            var sourceHeaderId = inboundQueueParams.source_record_ids;
            if (gs.nil(inboundQueueParams.requested_flow))
                throw "sourceToTargetConfigID cannot be null";
            if (gs.nil(inboundQueueParams.source_record_ids))
                throw "source record id cannot be null";
            var util = new sn_l2c_core.PrimitiveUtil();
            if (gs.nil(additionalParams))
                additionalParams = {};
            additionalParams[this.SKIP_LINES_KEY] = "true";

            // additional parameters are retrieved using the PrimitiveUtil() utility methods provided by the Lead to Cash Core application
            var service = util.getPrimitivesEPService(sourceToTargetConfigID, context);
            var isEmpty = false;
            if (service) {
                var createInstanceOutput = service.createInstance(sourceHeaderId, null, false, additionalParams);
                if (gs.nil(sourceHeaderId))
                    isEmpty = this.__isEmpty(createInstanceOutput.lineItems);
                else
                    isEmpty = this.__isEmpty(createInstanceOutput);
                if (!isEmpty) {
                    var effectOutput = service.effect(createInstanceOutput, null, additionalParams);
                    if (!this.__isEmpty(effectOutput)) {
                        var commitOutput = service.commitInstance(effectOutput, additionalParams);
                        return commitOutput;
                    }
                }
            }
            return result;
        },

        processInboundQueueRequest: function(inboundQueueGR) {
            gs.info("processRequest inboundQueueGR " + JSON.stringify(inboundQueueGR));
            var result = this.quoteUtil.createOrderFromQuoteUsingMetadata(inboundQueueGR.getValue('source_record_ids'), 'sn_l2c_quote_to_order', null, null, inboundQueueGR.getValue('record_id'));
            return result;
        },

        __isEmpty: function(sourceObj) {
            if (gs.nil(sourceObj))
                return true;
            return Object.keys(sourceObj).length === 0;
        },
        getMapingConfigIdFromSysId(requestedFlow) {
            var gr = new GlideRecord("sn_l2c_core_entity_mapping");
            gr.addQuery("sys_id", requestedFlow);
            gr.query();
            if (gr.next()) {
                gs.info("mapping id received to corresponding requestedFlow");
                return gr;
            }
        },

        type: 'IBQConfigQuoteToOrderFlowSNC'
    });

## IBQConfigBase -- generateParentRecord(Object ibqParams) {#ariaid-title2}

Creates a parent record which gets added to the record_id of the Inbound Request \[sn_tmt_core_inbound_queue_list\] record before processing the request.
Having a parent record created before processing is ideal for asynchronous
processing and allows you to add activities to your script include that can be performed while processing. For example, displaying a message on the
screen.
{#IBQCB-generateParentRecord_O__id_dpy_1kb_z2c__entry__3}{#IBQCB-generateParentRecord_O__ibqc-account}{#IBQCB-generateParentRecord_O__ibqc-consumer}{#IBQCB-generateParentRecord_O__ibqc-contact}{#IBQCB-generateParentRecord_O__ibqc-payload}{#IBQCB-generateParentRecord_O__ibqc-payload.additionalParams}{#IBQCB-generateParentRecord_O__ibqc-payload.additionalParams.action}{#IBQCB-generateParentRecord_O__ibqc-payload.additionalParams.actionReason}{#IBQCB-generateParentRecord_O__ibqc-payload.additionalParams.endDate}{#IBQCB-generateParentRecord_O__ibqc-payload.additionalParams.skipLines}{#IBQCB-generateParentRecord_O__ibqc-payload.additionalParams.startDate}{#IBQCB-generateParentRecord_O__ibqc-payload.context}{#IBQCB-generateParentRecord_O__ibqc-payload.context.isMultiselect}{#IBQCB-generateParentRecord_O__ibqc-payload.context.sTTCID}{#IBQCB-generateParentRecord_O__ibqc-payload.inputParams}{#IBQCB-generateParentRecord_O__ibqc-payload.source}{#IBQCB-generateParentRecord_O__ibqc-payload.headerId}{#IBQCB-generateParentRecord_O__ibqc-payload.source.lineIds}{#IBQCB-generateParentRecord_O__ibqc-payload.target}{#IBQCB-generateParentRecord_O__ibqc-payload.target.headerId}{#IBQCB-generateParentRecord_O__ibqc-payload.target.lineIds}{#IBQCB-generateParentRecord_O__ibqc-record}{#IBQCB-generateParentRecord_O__ibqc-requested_flow}{#IBQCB-generateParentRecord_O__ibqc-source_records_ids}{#IBQCB-generateParentRecord_O__ibqc-source_table}{#IBQCB-generateParentRecord_O__ibqc-table}

| Name | Type | Description |
|-|-|-|
| ibqParams | Object | JSON object containing the details of Inbound Request record to be created. { "account": "String", "consumer": "String", "contact": "String", "payload": {Object}, "record_id": "String", "requested_flow": "String", "source_record_ids": [Array], "source_table": "String", "table": "String" } |
| account | String | Optional. Information about the account associated with the record. Table: Account \[customer_account\] |
| consumer | String | Optional. Information about the consumer associated with the record. Table: Consumer \[csm_consumer\] |
| contact | String | Optional. Information about the contact associated with the record. Table: Contact \[customer_contact\] |
| payload | Object | Optional. JSON object needed to process the request using the PrimitiveUtil() API. For usage information, see [LeadToCashCore](https://servicenow-prod.fluidtopics.net/2N2YrqoO092vGEYqBEPtJA#LeadToCashCoreAPI "The LeadtoCashCore script include provides methods to orchestrate a lead-to-cash workflow in the Lead to Cash Core life cycle."). "payload": { "additionalParams": {Object}, "context": {Object}, "inputParams": {Object} "source": [Array of Objects], "target": [Array of Objects] } |
| payload.additionalParams | Object | Optional. Additional parameters to use. "additionalParams": { "action": "String", "actionReason": "String" "endDate": "Date", "skipLines": "Boolean", "startDate": "Date" } |
| payload.additionalParams.action | String | Optional. Specifies the type of declarative action being executed. For more information, see [Customer Life Cycle Management Workflows](https://www.servicenow.com/docs/access?context=customer-life-cycle-management-workflows&version=australia&pubname=australia-customer-service-management&ft:locale=en-US). Possible values: * disconnect * modify * resume * suspend |
| payload.additionalParams.actionReason | String | Optional. Property used in flows using declarative actions. Reason for the action. |
| payload.additionalParams.endDate | String | Optional. End date required to execute flows using declarative actions. Format: yyyy-MM-dd HH:mm:ss |
| payload.additionalParams.skipLines | Boolean | Optional. Flag that indicates whether to fetch line items for the specified entity. Valid values: * true: Skip returning line items information for the entity. * false: Return line items information for the entity. Default: false |
| payload.additionalParams.startDate | String | Optional. Start date to execute flows using declarative actions. Format: yyyy-MM-dd HH:mm:ss |
| payload.context | Object | Optional. Additional parameter options for displaying attribute values and for invoking more than one instance at a time. "context": { "isMultiSelect": "Boolean", "sourceToTargetConfigID": "String" } |
| payload.context.isMultiSelect | Boolean | Optional. Flag that indicates whether to pass multiple entities as input to create the instance. Valid values: * true: Enables passing multiple line items in a comma-separated list. * false: Only one input item can be passed in the script. Default: false |
| payload.context.sourceToTargetConfigID | String | Optional. Mapping configuration ID for the source-to-target mapping. Table: Lead To Cash Entity Mapping \[sn_l2c_core_entity_mapping\] |
| payload.inputParams | Object | Optional. This object is a placeholder for any input parameters required to invoke the usage of a specific flow. "inputParams": {} |
| payload.source | Array | Optional. JSON object containing details of the source entity to retrieve data from. "source": [ { "headerId": "String", "lineIds": [] } ] |
| payload.source.headerId | String | Optional. Header sys_id of source entity to retrieve data from. * Required if you don't provide the lineIds parameter. * Pass  null  if you aren't passing any header sys_ids. |
| payload.source.lineIds | Array | Optional. Array containing source line item sys_id(s) of an entity to retrieve entity data from. Required if you don't provide  the header ID, and if the entity structure starts with line items such as sold product. |
| payload.target | Array | Optional. JSON object containing details of the target entity. "target": [ { "headerId": "String", "lineIds": [] } ] |
| payload.target.headerId | String | Optional. Header sys_id of target entity to retrieve data from. Required if you don't provide the lineIds parameter. Pass  null  if you aren't passing any header sys_ids. |
| payload.target.lineIds | Array | Optional. Array containing target line item sys_id(s) of an entity to retrieve entity data from. Required if you don't provide  header ID  and if the entity structure starts with line items such as sold product. |
| record_id | String | Optional. Sys_id of the target record if already present. |
| requested_flow | String | Optional. Mapping configuration ID for source-to-target mapping. This property is required for flows using [Entity configuration and mapping](https://www.servicenow.com/docs/access?context=entity-configuration-and-mapping&version=australia&pubname=australia-order-management&ft:locale=en-US). Table: Lead To Cash Entity Mapping \[sn_l2c_core_entity_mapping\] |
| source_record_ids | Array | Array containing the sys_ids of the source records. |
| source_table | String | Name of the table that contains the source record of the flow. |
| table | String | Name of the table that contains the target record of the flow. |
[Tabelle : 1. Parameters]

{#IBQCB-generateParentRecord_O__id_dpy_1kb_z2c} {#IBQCB-generateParentRecord_O__table_qw2_3ct_y2c__entry__2}

| Type | Description |
|-|-|
| JSON object | A JSON object containing header ID of the target record created. { "headerID": "String", // additional parameters, if any, per flow see payload.inputParams } |
| headerID | Sys_id of the header of the target record created. This value is used to populate record_id field while creating the Inbound Request record. |
[Tabelle : 2. Returns]

{#IBQCB-generateParentRecord_O__table_qw2_3ct_y2c}  
The following example shows how to invoke the generateParentRecord() method.  
Hinweis:  
IBQConfigQuoteToOrderFlow is a custom script include that can be created by extending the IBQConfigBase API. The logic for the overridable methods must be added in the IBQConfigQuoteToOrderFlow script include.

    var ibqParams = {
      "source_record_ids": "f83e29574df02210f877142d1adc9531",
      "requested_flow": "0feb6d9da36271105c24939ef31e61dc",
      "initiated_by": "admin",
      "source_table": "sn_quote_mgmt_core_quote",
      "table": "sn_ind_tmt_orm_order",
      "payload": {}
    }; 

    var service = new sn_quote_mgmt.IBQConfigQuoteToOrderFlow(); 
    var parentRecord = service.generateParentRecord(ibqParams); 

    gs.info("Parent record = "+JSON.stringify(parentRecord));

Output:

    Parent record = {"headerID":"d11bd507dc6c6a10f877720033b5d0b9", ...} 

## IBQConfigBase -- getRunMode(Object ibqParams) {#ariaid-title3}

Determines whether a flow should run in sync or async mode.
{#IBQCB-getRunMode_O__id_dpy_1kb_z2c__entry__3}{#IBQCB-getRunMode_O__ibqc-account}{#IBQCB-getRunMode_O__ibqc-consumer}{#IBQCB-getRunMode_O__ibqc-contact}{#IBQCB-getRunMode_O__ibqc-payload}{#IBQCB-getRunMode_O__ibqc-payload.additionalParams}{#IBQCB-getRunMode_O__ibqc-payload.additionalParams.action}{#IBQCB-getRunMode_O__ibqc-payload.additionalParams.actionReason}{#IBQCB-getRunMode_O__ibqc-payload.additionalParams.endDate}{#IBQCB-getRunMode_O__ibqc-payload.additionalParams.skipLines}{#IBQCB-getRunMode_O__ibqc-payload.additionalParams.startDate}{#IBQCB-getRunMode_O__ibqc-payload.context}{#IBQCB-getRunMode_O__ibqc-payload.context.isMultiselect}{#IBQCB-getRunMode_O__ibqc-payload.context.sTTCID}{#IBQCB-getRunMode_O__ibqc-payload.inputParams}{#IBQCB-getRunMode_O__ibqc-payload.source}{#IBQCB-getRunMode_O__ibqc-payload.headerId}{#IBQCB-getRunMode_O__ibqc-payload.source.lineIds}{#IBQCB-getRunMode_O__ibqc-payload.target}{#IBQCB-getRunMode_O__ibqc-payload.target.headerId}{#IBQCB-getRunMode_O__ibqc-payload.target.lineIds}{#IBQCB-getRunMode_O__ibqc-record}{#IBQCB-getRunMode_O__ibqc-requested_flow}{#IBQCB-getRunMode_O__ibqc-source_records_ids}{#IBQCB-getRunMode_O__ibqc-source_table}{#IBQCB-getRunMode_O__ibqc-table}

| Name | Type | Description |
|-|-|-|
| ibqParams | Object | JSON object containing the details of Inbound Request record to be created. { "account": "String", "consumer": "String", "contact": "String", "payload": {Object}, "record_id": "String", "requested_flow": "String", "source_record_ids": [Array], "source_table": "String", "table": "String" } |
| account | String | Optional. Information about the account associated with the record. Table: Account \[customer_account\] |
| consumer | String | Optional. Information about the consumer associated with the record. Table: Consumer \[csm_consumer\] |
| contact | String | Optional. Information about the contact associated with the record. Table: Contact \[customer_contact\] |
| payload | Object | Optional. JSON object needed to process the request using the PrimitiveUtil() API. For usage information, see [LeadToCashCore](https://servicenow-prod.fluidtopics.net/2N2YrqoO092vGEYqBEPtJA#LeadToCashCoreAPI "The LeadtoCashCore script include provides methods to orchestrate a lead-to-cash workflow in the Lead to Cash Core life cycle."). "payload": { "additionalParams": {Object}, "context": {Object}, "inputParams": {Object} "source": [Array of Objects], "target": [Array of Objects] } |
| payload.additionalParams | Object | Optional. Additional parameters to use. "additionalParams": { "action": "String", "actionReason": "String" "endDate": "Date", "skipLines": "Boolean", "startDate": "Date" } |
| payload.additionalParams.action | String | Optional. Specifies the type of declarative action being executed. For more information, see [Customer Life Cycle Management Workflows](https://www.servicenow.com/docs/access?context=customer-life-cycle-management-workflows&version=australia&pubname=australia-customer-service-management&ft:locale=en-US). Possible values: * disconnect * modify * resume * suspend |
| payload.additionalParams.actionReason | String | Optional. Property used in flows using declarative actions. Reason for the action. |
| payload.additionalParams.endDate | String | Optional. End date required to execute flows using declarative actions. Format: yyyy-MM-dd HH:mm:ss |
| payload.additionalParams.skipLines | Boolean | Optional. Flag that indicates whether to fetch line items for the specified entity. Valid values: * true: Skip returning line items information for the entity. * false: Return line items information for the entity. Default: false |
| payload.additionalParams.startDate | String | Optional. Start date to execute flows using declarative actions. Format: yyyy-MM-dd HH:mm:ss |
| payload.context | Object | Optional. Additional parameter options for displaying attribute values and for invoking more than one instance at a time. "context": { "isMultiSelect": "Boolean", "sourceToTargetConfigID": "String" } |
| payload.context.isMultiSelect | Boolean | Optional. Flag that indicates whether to pass multiple entities as input to create the instance. Valid values: * true: Enables passing multiple line items in a comma-separated list. * false: Only one input item can be passed in the script. Default: false |
| payload.context.sourceToTargetConfigID | String | Optional. Mapping configuration ID for the source-to-target mapping. Table: Lead To Cash Entity Mapping \[sn_l2c_core_entity_mapping\] |
| payload.inputParams | Object | Optional. This object is a placeholder for any input parameters required to invoke the usage of a specific flow. "inputParams": {} |
| payload.source | Array | Optional. JSON object containing details of the source entity to retrieve data from. "source": [ { "headerId": "String", "lineIds": [] } ] |
| payload.source.headerId | String | Optional. Header sys_id of source entity to retrieve data from. * Required if you don't provide the lineIds parameter. * Pass  null  if you aren't passing any header sys_ids. |
| payload.source.lineIds | Array | Optional. Array containing source line item sys_id(s) of an entity to retrieve entity data from. Required if you don't provide  the header ID, and if the entity structure starts with line items such as sold product. |
| payload.target | Array | Optional. JSON object containing details of the target entity. "target": [ { "headerId": "String", "lineIds": [] } ] |
| payload.target.headerId | String | Optional. Header sys_id of target entity to retrieve data from. Required if you don't provide the lineIds parameter. Pass  null  if you aren't passing any header sys_ids. |
| payload.target.lineIds | Array | Optional. Array containing target line item sys_id(s) of an entity to retrieve entity data from. Required if you don't provide  header ID  and if the entity structure starts with line items such as sold product. |
| record_id | String | Optional. Sys_id of the target record if already present. |
| requested_flow | String | Optional. Mapping configuration ID for source-to-target mapping. This property is required for flows using [Entity configuration and mapping](https://www.servicenow.com/docs/access?context=entity-configuration-and-mapping&version=australia&pubname=australia-order-management&ft:locale=en-US). Table: Lead To Cash Entity Mapping \[sn_l2c_core_entity_mapping\] |
| source_record_ids | Array | Array containing the sys_ids of the source records. |
| source_table | String | Name of the table that contains the source record of the flow. |
| table | String | Name of the table that contains the target record of the flow. |
[Tabelle : 3. Parameters]

{#IBQCB-getRunMode_O__id_dpy_1kb_z2c} {#IBQCB-getRunMode_O__table_qw2_3ct_y2c__entry__2}

| Type | Description |
|-|-|
| String | Information about the run mode to be used to execute the request. Possible values: * async * sync {#IBQCB-getRunMode_O__ul_odv_kjb_z2c} |
[Tabelle : 4. Returns]

{#IBQCB-getRunMode_O__table_qw2_3ct_y2c}  
The following example shows how to invoke the getRunMode() method using the source sys_id provided by the source_record_ids property. If the line items count is greater than 10, then runMode is `async`.  
Hinweis:  
IBQConfigQuoteToOrderFlow is a custom script include that can be created by extending the IBQConfigBase API. The logic for the overridable methods must be added in the IBQConfigQuoteToOrderFlow script include.

    var ibqParams = {
      "source_record_ids": "04ba9004f11f3110f8777d7194f166f6",
      "requested_flow": "0feb6d9da36271105c24939ef31e61dc",
      "initiated_by": "admin",
      "source_table": "sn_quote_mgmt_core_quote",
      "table": "sn_ind_tmt_orm_order",
      "payload": {}
    };

    var service = new sn_quote_mgmt.IBQConfigQouteToOrderFlow();

    var runMode = service.getRunMode(ibqParams);

    gs.info("RunMode = "+JSON.stringify(runMode));

Output:

    RunMode = "async"

The following example shows how to invoke getRunMode() method. It uses the source sys_id provided in source_record_ids. Here the line items count is fewer than 10, so the runMode is sync.  
Hinweis:  
IBQConfigQuoteToOrderFlow is a custom script include that can be created by extending the IBQConfigBase API. The logic for the overridable methods must be added in the IBQConfigQuoteToOrderFlow script include.

    var ibqParams = {
      "source_record_ids": "0b0f5cc8f11f3110f8777d7194f16610",
      "requested_flow": "0feb6d9da36271105c24939ef31e61dc",
      "initiated_by": "admin",
      "source_table": "sn_quote_mgmt_core_quote",
      "table": "sn_ind_tmt_orm_order",
      "payload": {}
    };

    var service = new sn_quote_mgmt.IBQConfigQouteToOrderFlow();

    var runMode = service.getRunMode(ibqParams);

    gs.info("RunMode = "+JSON.stringify(runMode));

Output:

    RunMode = "sync"

## IBQConfigBase -- processInboundQueueRequest(GlideRecord ibqGr) {#ariaid-title4}

Defines the logic for processing an inbound request record.
{#IBQCB-processInboundQueueRequest_O__table_pw2_3ct_y2c__entry__3}

| Name | Type | Description |
|-|-|-|
| ibqGr | GlideRecord | [GlideRecord](https://servicenow-prod.fluidtopics.net/8HHfVDx4E4oXxHqKIqpUJQ#c_GlideRecordScopedAPI "The scoped GlideRecord API is used for database operations.") reference to the Inbound Request record that has triggered the flow. Table: Inbound Request \[sn_tmt_core_inbound_queue\]  |
[Tabelle : 5. Parameters]

{#IBQCB-processInboundQueueRequest_O__table_pw2_3ct_y2c} {#IBQCB-processInboundQueueRequest_O__table_qw2_3ct_y2c__entry__2}

| Type | Description |
|-|-|
| Object | A JSON object containing the processing details of the Inbound Request record. { "error": "String", "response": {Object}, "status": "String", "target": "String" } |
| error | Value indicating the error encountered while processing the request. Data type: String |
| response | A JSON object containing the response of processing the Inbound Request record. For flows created by the Lead to Cash Core PrimitiveUtil API, this output can be provided using the [commitInstance()](https://servicenow-prod.fluidtopics.net/2N2YrqoO092vGEYqBEPtJA#LTCC-commitInstance_O_O "Commits the JSON of a given lead to cash entity to the instance, returns a status message with updated information, and updates the Lead to Cash Core Entity table as a result.") method. Data type: Object |
| status | Value indicating the status of the request processing. Possible values: * failure -- The operation has failed. * partial_success -- There were few failures while processing the JSON object. Refer to processing logs in the Log \[syslog\] table to troubleshoot specific errors.  * success -- The operation was successful. {#IBQCB-processInboundQueueRequest_O__ul_fhl_mvl_1fc} Data type: String |
| target | Optional. Sys_id of the target record to be used for further processing, such as UI acknowledgment. The target can either be created during the flow or can be passed as input to the ibqParams of the generateParentRecord() method depending on the requirement. Data type: String |
[Tabelle : 6. Returns]

{#IBQCB-processInboundQueueRequest_O__table_qw2_3ct_y2c}  
The following example shows how to invoke processInboundQueueRequest() method.  
Hinweis:  
This method is called during the flow using [Flow Designer](https://www.servicenow.com/docs/access?context=flow-designer&version=australia&pubname=australia-application-development&ft:locale=en-US). In the following example, the Lead to Cash Core PrimitiveUtil [commitInstance()](https://servicenow-prod.fluidtopics.net/2N2YrqoO092vGEYqBEPtJA#LTCC-commitInstance_O_O "Commits the JSON of a given lead to cash entity to the instance, returns a status message with updated information, and updates the Lead to Cash Core Entity table as a result.") method is used to provide the output.

    var gr = new GlideRecord('sn_tmt_core_inbound_queue');
    gr.get('c48ea9974df02210f877142d1adc951a');

    var service = new sn_quote_mgmt.IBQConfigQuoteToOrderFlow();
    var processRequest = service.processInboundQueueRequest(gr);

    gs.info("processRequest = "+JSON.stringify(processRequest));

Output:

    processRequest = {
      "response": {
        "status": "success",
        "error": "",
        "message": "Commit operation successfully processed.",
        "displayMessage": "Commit operation successfully processed.",
        "dataObject": {
          "sys_id": "a6f4568bdce0aa10f877720033b5d069",
          "table": "sn_ind_tmt_orm_order",
          "attributes": {
            "account": {
              "value": "9e2fd2ee11b43110f877366201dea674"
            },
            "quote": {
              "value": "c8841a4bdce0aa10f877720033b5d0f8"
            }
          },
          "_glide_action": "UPDATE",
          "_source_object": {
            "sys_id": "c8841a4bdce0aa10f877720033b5d0f8",
            "table": "sn_quote_mgmt_core_quote"
          },
          "lineItems": [
            {
              "sys_id": "-1",
              "table": "sn_ind_tmt_orm_order_line_item",
              "attributes": {
                "short_description": {
                  "value": "Home Automation Bundle"
                },
                "account": {
                  "value": "9e2fd2ee11b43110f877366201dea674"
                }
              },
              "_glide_action": "INSERT",
              "_source_object": {
                "sys_id": "afc4528bdce0aa10f877720033b5d0d0",
                "table": "sn_quote_mgmt_core_quote_line_item"
              },
              "characteristics": [],
              "lineItems": [
                {
                  "sys_id": "-1",
                  "table": "sn_ind_tmt_orm_order_line_item",
                  "attributes": {
                    "short_description": {
                      "value": "Door Sensor"
                    },
                    "account": {
                      "value": "9e2fd2ee11b43110f877366201dea674"
                    }
                  },
                  "_glide_action": "INSERT",
                  "_source_object": {
                    "sys_id": "77c4528bdce0aa10f877720033b5d0d5",
                    "table": "sn_quote_mgmt_core_quote_line_item"
                  },
                  "characteristics": [],
                  "lineItems": [],
                  "pricingAdjustments": [
                    {
                      "sys_id": "-1",
                      "table": "sn_ind_tmt_orm_pricing_adjustment",
                      "attributes": {
                        "name": {
                          "value": "door sensor bundle discount"
                        }
                      },
                      "_glide_action": "INSERT",
                      "_source_object": {
                        "sys_id": "f3c4928bdce0aa10f877720033b5d02f",
                        "table": "sn_quote_mgmt_core_pricing_adjustment"
                      },
                      "_commitObjectInfo": {
                        "sys_id": "e6955acbdce0aa10f877720033b5d082",
                        "status": "success"
                      }
                    }
                  ],
                  "coveredProducts": [],
                  "attributeAdjustment": [],
                  "_commitObjectInfo": {
                    "sys_id": "26955acbdce0aa10f877720033b5d07d",
                    "status": "success"
                  }
                }
              ],
              "pricingAdjustments": [],
              "coveredProducts": [],
              "attributeAdjustment": [],
              "_commitObjectInfo": {
                "sys_id": "22955acbdce0aa10f877720033b5d078",
                "status": "success"
              }
            }
          ],
          "_commitObjectInfo": {
            "status": "success"
          }
        },
        "headerID": "a6f4568bdce0aa10f877720033b5d069",
        "rootLineIDs": [
          "22955acbdce0aa10f877720033b5d078"
        ]
      },
      "status": "success",
      "error": "",
      "target": "a6f4568bdce0aa10f877720033b5d069"
    }

## IBQConfigBase -- setExecuteAfterRequest(Object ibqParams) {#ariaid-title5}

Sets the `execute_after` value and updates `state` to Pending on the current inbound request record to configure the order in which records are processed in the Inbound Request table.
The setExecuteAfterRequest() method can be overridden to derive the execute_after value from other parameters. By default, this method queries the Inbound Request \[sn_tmt_core_inbound_queue\]
table to find the latest record with matching source_record_ids, record_id, and resource values. This method then updates the current record's
`execute_after` field with the queried record's sys_id, marking the current record to be processed after the queried record. As a result, setExecuteAfterRequest() establishes the order in which
records are processed.
{#IBQCB-setExecuteAfterRequest_O__table_hbf_vqr_tfc__entry__3}

| Name | Type | Description |
|-|-|-|
| ibqParams | Object | JSON object containing the details of Inbound Request records to set. These parameters include the record sys_id to process before the current record, and the workflow name to filter by in the Inbound Request \[sn_tmt_core_inbound_queue\] table. { "account": "String", "consumer": "String", "contact": "String", "execute_after": "String", "payload": {Object}, "record_id": "String", "requested_flow": "String", "resource": "String", "source_record_ids": [Array], "source_table": "String", "table": "String" } |
| account | String | Optional. Information about the account associated with the record. Table: Account \[customer_account\] |
| consumer | String | Optional. Information about the consumer associated with the record. Table: Consumer \[csm_consumer\] |
| contact | String | Optional. Information about the contact associated with the record. Table: Contact \[customer_contact\] |
| ibqParams.execute_after | String | Optional. Sys_id of inbound request to process before the current request. Table: Inbound Request \[sn_tmt_core_inbound_queue\] |
| payload | Object | Optional. JSON object needed to process the request using the PrimitiveUtil() API. For usage information, see [LeadToCashCore](https://servicenow-prod.fluidtopics.net/2N2YrqoO092vGEYqBEPtJA#LeadToCashCoreAPI "The LeadtoCashCore script include provides methods to orchestrate a lead-to-cash workflow in the Lead to Cash Core life cycle."). "payload": { "additionalParams": {Object}, "context": {Object}, "inputParams": {Object} "source": [Array of Objects], "target": [Array of Objects] } |
| payload.additionalParams | Object | Optional. Additional parameters to use. "additionalParams": { "action": "String", "actionReason": "String" "endDate": "Date", "skipLines": "Boolean", "startDate": "Date" } |
| payload.additionalParams.action | String | Optional. Specifies the type of declarative action being executed. For more information, see [Customer Life Cycle Management Workflows](https://www.servicenow.com/docs/access?context=customer-life-cycle-management-workflows&version=australia&pubname=australia-customer-service-management&ft:locale=en-US). Possible values: * disconnect * modify * resume * suspend |
| payload.additionalParams.actionReason | String | Optional. Property used in flows using declarative actions. Reason for the action. |
| payload.additionalParams.endDate | String | Optional. End date required to execute flows using declarative actions. Format: yyyy-MM-dd HH:mm:ss |
| payload.additionalParams.skipLines | Boolean | Optional. Flag that indicates whether to fetch line items for the specified entity. Valid values: * true: Skip returning line items information for the entity. * false: Return line items information for the entity. Default: false |
| payload.additionalParams.startDate | String | Optional. Start date to execute flows using declarative actions. Format: yyyy-MM-dd HH:mm:ss |
| payload.context | Object | Optional. Additional parameter options for displaying attribute values and for invoking more than one instance at a time. "context": { "isMultiSelect": "Boolean", "sourceToTargetConfigID": "String" } |
| payload.context.isMultiSelect | Boolean | Optional. Flag that indicates whether to pass multiple entities as input to create the instance. Valid values: * true: Enables passing multiple line items in a comma-separated list. * false: Only one input item can be passed in the script. Default: false |
| payload.context.sourceToTargetConfigID | String | Optional. Mapping configuration ID for the source-to-target mapping. Table: Lead To Cash Entity Mapping \[sn_l2c_core_entity_mapping\] |
| payload.inputParams | Object | Optional. This object is a placeholder for any input parameters required to invoke the usage of a specific flow. "inputParams": {} |
| payload.source | Array | Optional. JSON object containing details of the source entity to retrieve data from. "source": [ { "headerId": "String", "lineIds": [] } ] |
| payload.source.headerId | String | Optional. Header sys_id of source entity to retrieve data from. * Required if you don't provide the lineIds parameter. * Pass  null  if you aren't passing any header sys_ids. |
| payload.source.lineIds | Array | Optional. Array containing source line item sys_id(s) of an entity to retrieve entity data from. Required if you don't provide  the header ID, and if the entity structure starts with line items such as sold product. |
| payload.target | Array | Optional. JSON object containing details of the target entity. "target": [ { "headerId": "String", "lineIds": [] } ] |
| payload.target.headerId | String | Optional. Header sys_id of target entity to retrieve data from. Required if you don't provide the lineIds parameter. Pass  null  if you aren't passing any header sys_ids. |
| payload.target.lineIds | Array | Optional. Array containing target line item sys_id(s) of an entity to retrieve entity data from. Required if you don't provide  header ID  and if the entity structure starts with line items such as sold product. |
| record_id | String | Optional. Sys_id of the target record if already present. |
| requested_flow | String | Optional. Mapping configuration ID for source-to-target mapping. This property is required for flows using [Entity configuration and mapping](https://www.servicenow.com/docs/access?context=entity-configuration-and-mapping&version=australia&pubname=australia-order-management&ft:locale=en-US). Table: Lead To Cash Entity Mapping \[sn_l2c_core_entity_mapping\] |
| ibqParams.resource | String | Name of the flow that creates the record in the Inbound Request table (for example, a quote or order). This value is used to find dependent records of the same type to determine the order of record processing. |
| source_record_ids | Array | Array containing the sys_ids of the source records. |
| source_table | String | Name of the table that contains the source record of the flow. |
| table | String | Name of the table that contains the target record of the flow. |
[Tabelle : 7. Parameters]

{#IBQCB-setExecuteAfterRequest_O__table_hbf_vqr_tfc} {#IBQCB-setExecuteAfterRequest_O__table_ibf_vqr_tfc__entry__2}

| Type | Description |
|-|-|
| None |   |
[Tabelle : 8. Returns]

{#IBQCB-setExecuteAfterRequest_O__table_ibf_vqr_tfc}  
In the following example, the script queries the Inbound Request \[sn_tmt_core_inbound_queue\] table to find the latest record with matching source_record_ids, record_id, and resource values. The script then calls the
setExecuteAfterRequest() method to update the current record's execute_after value with the fetched record's sys_id and sets its state to pending. As a result, the current record will execute after the record
specified in the execute_after field.

    var ibqParams = { 
      "source_record_ids": "e32e29fd28d26a14f8775b8f954723b8",
      "record_id":"b9be293128166a14f8775b8f9547239f", 
      "requested_flow": "0feb6d9da36271105c24939ef31e61dc", 
      "initiated_by": "admin", 
      "source_table": "sn_quote_mgmt_core_quote", 
      "table": "sn_ind_tmt_orm_order", 
      "payload": {
      "context": {}}, 
      "resource": "quote_to_order" 
     }; 

    new sn_tmt_core.IBQConfigBase().setExecuteAfterRequest(ibqParams);

This method does not return any output.

