CLIC Method Interceptor API

Overview

This API is designed for working with Quotes, Contracts, Rebate Agreements, and Compensation Plans. It provides functionality for both list and detail views of these entities.

API Naming Convention

The API name varies based on the module where it's used:

  • Quotes: quoteAPI

  • Compensation Plans: compensationPlanAPI

  • Contracts: contractAPI

  • Rebate Agreements: rebateAgreementAPI

Usage Example

export const quotesDetailAccountAssign = ({ quoteAPI }) => { // code }

Special Cases

For specific interceptor methods, the API names are:

  • quotesDetailCreateNewRevision: quoteNewRevisionAPI

  • quotesDetailCopy: quoteCopyAPI

  • Origin API: quoteOriginAPI

Similar patterns apply for Contracts, Rebate Agreements, and Compensation Plans.

API Methods

addHeaderInput

Adds an input to the CLIC header.

Parameters:

  • input: Object - The input object to be added

addLineItems

Adds line items to the CLIC object.

Parameters:

  • lineItemIds: string[] - Array of line item IDs

deleteLineItems

Deletes line items from the CLIC object.

Parameters:

  • lineItemsIds: string[] - Array of line item IDs

Example:

export const quotesDetailOpen = async ({ quoteAPI }) => { const lineItems = await quoteAPI.getLineItems(); const response = await quoteAPI.deleteLineItems([lineItems[0].lineId]); console.log({ response }); // 1 };

disableHeaderInputs

Disables inputs at the CLIC header. (CLIC Detail Only)

Parameters:

  • inputNames: string | string[] - Name(s) of input(s) to disable

Example:

export const quotesDetailOpen = async ({ quoteAPI }) => { await quoteAPI.disableHeaderInputs('Customer'); // or ['Customer', ...] }

getHeaderInput

Gets an input by inputName from the CLIC header.

Parameters:

  • inputName: string - The name of the input

Example:

getHeaderInputValue

Returns an input value from the CLIC header.

Parameters:

  • inputName: string - The name of the input

Example:

getHeaderOutput

Gets an output by outputName from the CLIC header.

Parameters:

  • outputName: string - The name of the output

Example:

getHeaderOutputResult

Returns an output result from the CLIC header.

Parameters:

  • outputName: string - The name of the output

Example:

getHeaderType

Retrieves CLIC header type.

Example:

getHeaderValue

Gets a value from the CLIC header.

Parameters:

  • name: string - The name of the property to obtain

Example:

getLineItemInput

Returns an input by name from the first line item fetched by queryData.

Parameters:

  • queryData: QueryData

  • name: string - The name of the input

getLineItemInputValue

Returns a value from the input defined by name from a line item.

Parameters:

  • queryData: QueryData

  • name: string - The name of the input

getLineItemOutput

Returns an output by resultName from the first line item fetched by queryData.

Parameters:

  • queryData: QueryData

  • resultName: string - The name of the output

getLineItemOutputResult

Returns a result from the output defined by outputName from a line item.

Parameters:

  • queryData: QueryData

  • outputName: string - The name of the output

getLineItems

Fetches items from CLIC by queryData.

Parameters:

  • queryData: QueryData

getLineItemsInPage

Fetches items as a page from CLIC by queryData and limit.

Parameters:

  • queryData: QueryData

  • limit: number

recalculate

Triggers a recalculation at the CLIC object.

Parameters:

  • forceAsync: boolean (optional) - Force the recalculation as an async job

setDisabledButtons

Disables CLIC detail buttons in the header/items tabs. (CLIC Detail Only)

Parameters:

  • buttons: string | string[] - Button(s) to disable

Example:

setHeaderInputValue

Sets an input value at the CLIC header.

Parameters:

  • inputName: string - The name of the input

  • value: any - The value to set

Example:

setHeaderOutputResult

Sets an output result at the CLIC header.

Parameters:

  • outputName: string - The name of the output

  • value: any - The result value of the output

Example:

setHeaderValue

Updates a field at the CLIC header.

Parameters:

  • name: string - The name of field at the CLIC header

  • value: any - The value of the field to be set

Example:

setLineItemInputValue

Sets a value of the input with a name which is at the first line item defined by queryData.

Parameters:

  • queryData: QueryData

  • name: string - The name of the input

  • value: any - The value of the input

setLineItemInputValues

Updates multiple line item inputs values at once.

Parameters:

  • queryData: QueryData

  • inputsToAdd: Object - Key-value pairs of input names and their values

Example:

setReadOnly

Sets the CLIC object as read-only in UI. (CLIC Detail Only)

Parameters:

  • readOnly: boolean

Example:

updateHeader

Updates header values and header input values.

Parameters:

  • values: Object - Key-value pairs of header field names and their values

  • inputValues: Object - Key-value pairs of header input names and their values

Example:

Notes

  • Some methods are only applicable in CLIC Detail view and not in list view.

  • When using dot notation for nested inputs (e.g., collapsibleSectionWithRow.row1.stringUserEntry1_collapsible_row1), ensure the path is correct.

  • Always handle promises returned by these methods appropriately in your code.