--- title: IBQConfigBase API - Scoped description: Script include that must be extended for Sales Customer Relationship Management Request Tracker to track the requests. This script include provides overridable methods that define how requests should be executed.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.Determines whether a flow should run in sync or async mode.Defines the logic for processing an inbound request record.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. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/api-reference/server-api-reference/IBQConfigBaseAPIBoth.html release: australia product: Server API Reference classification: server-api-reference topic_type: concept last_updated: "2026-03-12" reading_time_minutes: 18 breadcrumb: [Server API reference, API reference, API implementation and reference] --- # IBQConfigBase API - Scoped Script include that must be extended for Sales Customer Relationship 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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/order-management/lead-to-cash.md) - [Inbound Request](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/order-management/som_request_tracker.md) ## Extending the IBQConfigBase API Define a script include with the overridable methods of the IBQConfigBase API. 1. Create a script include. The name must start with `IBQConfig`, 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. ## Use case: IBQConfigQuoteToOrderFlow 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. **Note:** 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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/LeadToCashCoreAPI.md). ``` 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' }); ``` **Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md) ## IBQConfigBase – generateParentRecord\(Object ibqParams\) 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.
| 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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/LeadToCashCoreAPI.md).``` "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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/customer-service-management/customer-life-cycle-management-workflows.md).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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/order-management/entity-configuration-and-mapping.md).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. |
| 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. |
| 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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/LeadToCashCoreAPI.md).``` "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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/customer-service-management/customer-life-cycle-management-workflows.md).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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/order-management/entity-configuration-and-mapping.md).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. |
| Type | Description |
|---|---|
| String | Information about the run mode to be used to execute the request.Possible values: - async - sync |
| Name | Type | Description |
|---|---|---|
| ibqGr | GlideRecord | [GlideRecord](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/c_GlideRecordScopedAPI.md) reference to the Inbound Request record that has triggered the flow.Table: Inbound Request \[sn\_tmt\_core\_inbound\_queue\] |
| 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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/LeadToCashCoreAPI.md) 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. 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 |
| 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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/LeadToCashCoreAPI.md).``` "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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/customer-service-management/customer-life-cycle-management-workflows.md).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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/order-management/entity-configuration-and-mapping.md).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. |