Interceptor Methods

How 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.

Structure of method name
image-20241009-102759.png
Quote List

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.

 

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: Common Interceptor API | crmManager allows you to access CRM system, but it is only available inside CRM system.
notify: Common Interceptor API | notify is used for calling notification.
navigate: 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.

The idea behind is that the PRE code will run before the intercepted method, i.e. when you have a PRE method to create a new quote, this will run before the quote is created, and in case your PRE method returns false it will stop and the quote will not be created.

If it returns some value, it is passed to Pricefx and can be used according to the method.

Then, the POST code will run.

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