Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
minLevel1
maxLevel2
outlinefalse
typelist
printablefalse

How

...

This sample of a JavaScript code will be structured like this:

Code Block
export const compensationsDetailCreateNewRevision = async ({ compensationPlanOriginAPI, compensationPlanNewRevisionAPI, api: { notify }}) => {
  await notify.success('Triggered interceptor compensationsDetailCreateNewRevision');
  // TODO: Add your code
}

For each method that should trigger something, there will be a function exported. This function has one argument which has different APIs that will offer interaction with Pricefx, and CLIC data manipulation.

To find the type definitions and documentation of all available methods and their available APIs, click here. If you struggle to find out exactly what is available, you can run a specific interceptor method with a debugger:

...

to Choose and Use Interceptor Method

All interceptor method names follow a simple naming structure. For example, let's break down the name quotesDetailCreateNewRevision and understand when this method will be called. Quotes indicates that this function will be triggered on a quote page module. Detail implies that it will be triggered on a single selected or opened quote. Meanwhile, quote list would be triggered only on the list. Lastly, CreateNewRevision suggests that the interceptor will be triggered when a new revision will be created.

...

Here you can find all available interceptor Method Names.

How to Use Interceptor Methods

On the top level of the JS file, you can declare multiple interceptor methods.

image-20241009-103139.pngImage Added

Interceptor Method Parameters

With a parameter you can make a query in a CRM system, call notification in Pricefx, etc. Parameters are an essential part of the Interceptors.

What Parameters Does the Interceptor Method Have?

Every interceptor has its own unique set of parameters, but there is a logic behind understanding what parameters you can expect to find in different interceptor methods.

api: is a common parameter for all interceptor methods https://pricefx.atlassian.net/wiki/x/OACnRwE .

quoteAPI: is only available in the Quoting module CLIC Method Interceptor API .

compensationPlanAPI: is only available in the Sales Compensations module CLIC Method Interceptor API .

contractAPI: is only available in the Agreements & Promotions module CLIC Method Interceptor API .

rebateAgreementAPI: is only available in the Rebates module CLIC Method Interceptor API .

opportunityId: is available in methods with action OpportunityAssign.

accountId: is available in methods with action AccountAssign.

filter: is available in methods with action that contains word filter, for example action: FilterAdd.

For more details about the parameters that each method has, you can refer to the interceptor Method Names.

More About API Parameter

In api parameter, the most commonly used functions are:

crmManager: https://pricefx.atlassian.net/wiki/spaces/INTERC/pages/5497094200/Common+Interceptor+API#crmManager allows you to access CRM system, but it is only available inside CRM system.
notify: https://pricefx.atlassian.net/wiki/spaces/INTERC/pages/5497094200/Common+Interceptor+API#notify is used for calling notification.
navigate: https://pricefx.atlassian.net/wiki/spaces/INTERC/pages/5497094200/Common+Interceptor+API#navigate with this function, you can navigate to other pages or even create new quote with selected type.

This is not all you can do with api. Explore Interceptor API and find more functions that you can call from api.

PRE and POST Methods

Some methods have both the options – to add PRE and POST code.

...

PRE and POST methods have the same name, and for PRE ones they must have a Pre suffix.
Example: quotesDetailNew (POST) and quotesDetailNewPre (PRE)

...

...

Info

Available from version 14.0

You can edit Interceptor's code directly from Pricefx.

  1. Go to Administration > Configuration > CRM Integration > Interceptors.

  2. Click Edit interceptor.

  3. The window with the code of the currently Active interceptor will appear.

...