Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
How to Choose and Use
...
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:
...
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.
...
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, InterceptorMethodAPI.
quoteAPI
: is only available in the Quoting module.
compensationPlanAPI
: is only available in the Sales Compensations module.
contractAPI
: is only available in the Agreements & Promotions module.
rebateAgreementAPI
: is only available in the Rebates module.
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
: InterceptorMethodAPI | crmManager allows you to access CRM system, but it is only available inside CRM system.notify
: InterceptorMethodAPI | notify is used for calling notification.navigate
: InterceptorMethodAPI | 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 InterceptorMethodAPI 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.
...