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.
- 1 Overview
- 2 API Naming Convention
- 2.1 Usage Example
- 2.2 Special Cases
- 3 API Methods
- 3.1 addHeaderInput
- 3.2 addLineItems
- 3.3 deleteLineItems
- 3.4 disableHeaderInputs
- 3.5 getHeaderInput
- 3.6 getHeaderInputValue
- 3.7 getHeaderOutput
- 3.8 getHeaderOutputResult
- 3.9 getHeaderType
- 3.10 getHeaderValue
- 3.11 getLineItemInput
- 3.12 getLineItemInputValue
- 3.13 getLineItemOutput
- 3.14 getLineItemOutputResult
- 3.15 getLineItems
- 3.16 getLineItemsInPage
- 3.17 recalculate
- 3.18 setDisabledButtons
- 3.19 setHeaderInputValue
- 3.20 setHeaderOutputResult
- 3.21 setHeaderValue
- 3.22 setLineItemInputValue
- 3.23 setLineItemInputValues
- 3.24 setReadOnly
- 3.25 updateHeader
- 4 Notes
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
: QueryDataname
: string - The name of the input
getLineItemInputValue
Returns a value from the input defined by name from a line item.
Parameters:
queryData
: QueryDataname
: string - The name of the input
getLineItemOutput
Returns an output by resultName from the first line item fetched by queryData.
Parameters:
queryData
: QueryDataresultName
: string - The name of the output
getLineItemOutputResult
Returns a result from the output defined by outputName from a line item.
Parameters:
queryData
: QueryDataoutputName
: 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
: QueryDatalimit
: 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 inputvalue
: any - The value to set
Example:
setHeaderOutputResult
Sets an output result at the CLIC header.
Parameters:
outputName
: string - The name of the outputvalue
: 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 headervalue
: 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
: QueryDataname
: string - The name of the inputvalue
: any - The value of the input
setLineItemInputValues
Updates multiple line item inputs values at once.
Parameters:
queryData
: QueryDatainputsToAdd
: 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 valuesinputValues
: 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.