ClicInterceptorAPI: { addHeaderInput: ((input: Input) => Promise<any>); addLineItems: ((lineItemIds: string[]) => Promise<any>); disableHeaderInputs: ((inputNames: string | string[]) => any); getHeaderInput: ((inputName: string) => Promise<ClicInput>); getHeaderInputValue: ((inputName: string) => Promise<any>); getHeaderOutput: ((outputName: string) => Promise<Output | undefined>); getHeaderOutputResult: ((outputName: string) => Promise<any>); getHeaderValue: ((name: string) => Promise<any>); getLineItemInput: ((queryData: QueryData, name: string) => Promise<ClicInput>); getLineItemInputValue: ((queryData: QueryData, name: string) => Promise<any>); getLineItemOutput: ((queryData: QueryData, resultName: string) => Promise<Output>); getLineItemOutputResult: ((queryData: QueryData, outputName: string) => Promise<Output>); getLineItems: ((queryData: QueryData) => Promise<LineItem[]>); getLineItemsInPage: ((queryData: QueryData, limit: number) => Promise<LineItemPage>); recalculate: ((forceAsync?: boolean) => Promise<any>); setDisabledButtons: ((buttons: string | string[]) => any); setHeaderInputValue: ((inputName: string, value: any) => Promise<any>); setHeaderOutputResult: ((outputName: string, value: any) => Promise<any>); setHeaderValue: ((name: string, value: any) => Promise<any>); setLineItemInputValue: ((queryData: QueryData, name: string, value: any) => Promise<any>); setLineItemInputValues: ((queryData: QueryData, inputsToAdd: { [inputName: string]: any }) => Promise<any>); setReadOnly: ((readOnly: boolean) => Promise<any>) }

This is API for working with Quotes, Contracts, Rebate Agreements and Compensation Plans. It works with lists and details of these entities.

Name of this API will vary based on the module where you are using it. For quotes it will be:

export const quotesDetailAccountAssign = ({ quoteAPI }) => {
// code
}
  • Compensation Plans: compensationPlanAPI
  • Contracts: contractAPI
  • Rebate Agreements: rebateAgreementAPI
  • Quotes: quoteAPI

If you use the interceptor methods quotesDetailCreateNewRevision, quotesDetailCopy and the same alternatives for Contracts, Rebate Agreements and Compensation Plans, you will get this API under the names quoteOriginAPI, quoteNewRevisionAPI or quoteCopyAPI (similar pattern for others).

All these variables contains an object which implement this ClicInterceptorAPI type.

Type declaration

  • addHeaderInput: ((input: Input) => Promise<any>)
      • (input: Input): Promise<any>
      • Adds an input to the CLIC header.

        Parameters

        • input: Input

          The object of the input.

        Returns Promise<any>

  • addLineItems: ((lineItemIds: string[]) => Promise<any>)
      • (lineItemIds: string[]): Promise<any>
      • Parameters

        • lineItemIds: string[]

        Returns Promise<any>

  • disableHeaderInputs: ((inputNames: string | string[]) => any)
      • (inputNames: string | string[]): any
      • Disables inputs at the CLIC header.

        CLIC Detail Only - In a list, this method does not make sense, so it is implemented just as an empty method there.

        Example

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

        Parameters

        • inputNames: string | string[]

        Returns any

  • getHeaderInput: ((inputName: string) => Promise<ClicInput>)
      • (inputName: string): Promise<ClicInput>
      • Gets an input by inputName from the CLIC header.

        Example

        export const quotesDetailOpen = async ({ quoteAPI }) => {
        const clicInput = await quoteAPI.getHeaderInput('Customer');
        console.log(clicInput);
        }

        Parameters

        • inputName: string

          The name of the input.

        Returns Promise<ClicInput>

  • getHeaderInputValue: ((inputName: string) => Promise<any>)
      • (inputName: string): Promise<any>
      • Returns an input value from the CLIC header.

        Example

        export const quotesDetailOpen = async ({ quoteAPI }) => {
        const clicInputValue = await quoteAPI.getHeaderInputValue('Customer');
        console.log(clicInputValue);
        }

        Parameters

        • inputName: string

          The name of the input.

        Returns Promise<any>

  • getHeaderOutput: ((outputName: string) => Promise<Output | undefined>)
      • (outputName: string): Promise<Output | undefined>
      • Gets an output by outputName from the CLIC header.

        Example

        export const quotesDetailOpen = async ({ quoteAPI }) => {
        const clicOutput = await quoteAPI.getHeaderOutput('outputName');
        console.log(clicOutput);
        }

        Parameters

        • outputName: string

          The name of the output.

        Returns Promise<Output | undefined>

  • getHeaderOutputResult: ((outputName: string) => Promise<any>)
      • (outputName: string): Promise<any>
      • Returns an output result from the CLIC header.

        Example

        export const quotesDetailOpen = async ({ quoteAPI }) => {
        const clicOutputResult = await quoteAPI.getHeaderOutputResult('outputName');
        console.log(clicOutputResult);
        }

        Parameters

        • outputName: string

          The name of the output.

        Returns Promise<any>

  • getHeaderValue: ((name: string) => Promise<any>)
      • (name: string): Promise<any>
      • Gets a value from the CLIC header. Use it to obtain properties such as version, externalRef, calculationStatus, etc.

        Example

        export const quotesDetailOpen = async ({ quoteAPI }) => {
        const quoteStatus = await quoteAPI.getHeaderValue('quoteStatus');
        console.log(quoteStatus) // 'DRAFT'
        }

        Parameters

        • name: string

          The name of the property which you want obtain.

        Returns Promise<any>

  • getLineItemInput: ((queryData: QueryData, name: string) => Promise<ClicInput>)
      • (queryData: QueryData, name: string): Promise<ClicInput>
      • Returns an input by name from the first line item fetched by queryData.

        Parameters

        • queryData: QueryData
        • name: string

          The name of input

        Returns Promise<ClicInput>

  • getLineItemInputValue: ((queryData: QueryData, name: string) => Promise<any>)
      • (queryData: QueryData, name: string): Promise<any>
      • Returns a value from the input defined by name from a line item which is the first in the response defined by queryData.

        Parameters

        • queryData: QueryData
        • name: string

          The name of the input.

        Returns Promise<any>

  • getLineItemOutput: ((queryData: QueryData, resultName: string) => Promise<Output>)
      • (queryData: QueryData, resultName: string): Promise<Output>
      • Returns an output by resultName from the first line item fetched by queryData.

        Parameters

        • queryData: QueryData
        • resultName: string

          The name of the output.

        Returns Promise<Output>

  • getLineItemOutputResult: ((queryData: QueryData, outputName: string) => Promise<Output>)
      • (queryData: QueryData, outputName: string): Promise<Output>
      • Returns a result from the output defined by outputName from a line item which is the first in the response defined by queryData.

        Parameters

        • queryData: QueryData
        • outputName: string

          The name of the output.

        Returns Promise<Output>

  • getLineItems: ((queryData: QueryData) => Promise<LineItem[]>)
  • getLineItemsInPage: ((queryData: QueryData, limit: number) => Promise<LineItemPage>)
  • recalculate: ((forceAsync?: boolean) => Promise<any>)
      • (forceAsync?: boolean): Promise<any>
      • Triggers a recalculation at the CLIC object.
        By default, it is decided if the recalculation is triggered as async by Async actions threshold, which is defined in Administration > Configuration >…. You can force the trigger as async by passing true to the forceAsync parameter.

        Parameters

        • Optional forceAsync: boolean

          The recalculation will we triggered as an async job.

        Returns Promise<any>

  • setDisabledButtons: ((buttons: string | string[]) => any)
      • (buttons: string | string[]): any
      • Disables CLIC detail buttons in the header/items tabs. The options are:

        • Header tab: submit, calculate, startCreationWorkflow, nextStepCreationWorkflow, backStepCreationWorkflow, finishCreationWorkflow, finishCreationWorkflowAndSubmit, withdraw, markOfferAsLost, convertToDeal, reconvertToDeal, revoke, createNewRevision, emailing, emailingAndSignature, createOpportunity, assignOpportunity, assignAccount, duplicate, remove.

        • Items tab:

          • Header action buttons: add_items, browse_items, add_recommended_items, addFolder, massEdit, copyAllItemsToClipboard, importItemsToClipboard.

          • Selection context buttons: deleteItems, duplicateItems, moveItemsToFolder.

        CLIC Detail Only - In a list, this method does not make sense, so it is implemented just as an empty method there.

        Example

        export const quotesDetailOpen = ({ quoteAPI }) => {
        // When a user opens a Quote, it has disabled buttons Recalculate, Duplicate and Assign Account
        quoteAPI.setDisabledButtons(['calculate', 'assignAccount', 'duplicate']);
        }

        Parameters

        • buttons: string | string[]

        Returns any

  • setHeaderInputValue: ((inputName: string, value: any) => Promise<any>)
      • (inputName: string, value: any): Promise<any>
      • Sets an input value at the CLIC header.

        Example

        export const quotesDetailOpen = async ({ quoteAPI }) => {
        // Simple inputs
        await quoteAPI.setHeaderInputValue('ProjectID', 'Some ID');
        await quoteAPI.setHeaderInputValue('ProjectName', 'Project Name');

        // Input with configurator
        await quoteAPI.setHeaderInputValue('Configurator_Documents', {
        InvoiceMethod: 'Invoice method',
        OpportunityOwner: 'Name',
        OpportunityOwnerEmail: 'Email',
        OpportunityOwnerPhone: 'Phone',
        OpportunityOwnerTitle: 'Title'
        });
        }

        Parameters

        • inputName: string

          The name of the input.

        • value: any

        Returns Promise<any>

  • setHeaderOutputResult: ((outputName: string, value: any) => Promise<any>)
      • (outputName: string, value: any): Promise<any>
      • Sets an output result at the CLIC header.

        Example

        export const quotesDetailOpen = async ({ quoteAPI }) => {
        const clicOutputResult = await quoteAPI.setHeaderOutputResult('outputName', 'Test value');
        console.log(clicOutputResult);
        }

        Parameters

        • outputName: string

          The name of the output.

        • value: any

          The result value of the output.

        Returns Promise<any>

  • setHeaderValue: ((name: string, value: any) => Promise<any>)
      • (name: string, value: any): Promise<any>
      • Updates a field at the CLIC header. Use it to update properties such as expiryDate, externalRef, additionalInfo1, etc

        Example

        export const quotesDetailNew = async ({ quoteAPI }) => {
        await quoteAPI.setHeaderValue('label', 'Updated label from intercepted method');
        }

        Parameters

        • name: string

          The name of field at the CLIC header.

        • value: any

          The value of the field which will be set.

        Returns Promise<any>

  • setLineItemInputValue: ((queryData: QueryData, name: string, value: any) => Promise<any>)
      • (queryData: QueryData, name: string, value: any): Promise<any>
      • 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.

        Returns Promise<any>

  • setLineItemInputValues: ((queryData: QueryData, inputsToAdd: { [inputName: string]: any }) => Promise<any>)
      • (queryData: QueryData, inputsToAdd: { [inputName: string]: any }): Promise<any>
      • Updates multiple line item inputs values at once.

        Example

        export const quotesDetailOpen = async ({ quoteAPI }) => {
        await quoteAPI.setLineItemInputValues('product-1', {Quantity: 3, Customer: 'CD-0001'});
        }

        Parameters

        • queryData: QueryData
        • inputsToAdd: { [inputName: string]: any }
          • [inputName: string]: any

        Returns Promise<any>

  • setReadOnly: ((readOnly: boolean) => Promise<any>)
      • (readOnly: boolean): Promise<any>
      • Sets the CLIC object as read-only in UI.

        CLIC Detail Only - In a list, this method does not make sense, so it is implemented just as an empty method there.

        Example

        export const quotesDetailOpen = ({ quoteAPI }) => {
        quoteAPI.setReadOnly(true);
        }

        Parameters

        • readOnly: boolean

        Returns Promise<any>

Generated using TypeDoc