FAQ

Interceptor throws error after switching to React from Ember

Unfortunately interceptors between Ember and React are not compatible. If you want to switch to react, you will need to rewrite interceptor and use interceptor methods and API’s created for react.

Why is Interceptor working on the account page, but is not working on the opportunity page?

Check Configuration > CRM Integration > Interceptors in both pages:

If one of the iFrames is showing that Interceptor is not set, then most likely it happened because each iFrame has it own CRM configuration (this is correct), for example:

  • iFrame in the Account Page is using crm_config_account

  • iFrame in the Opportunity Page is using crm_config_opportunity

Simply set same Interceptor on Opportunity Page from pricefx, or if you want to use Pricefx Studio/Pricefx Code find CRM config which is used by opportunity and add new field "interceptor": "name of the interceptor".

Why do I keep getting Promise<Pending> when using API?

Use await or then when using API.

If you do not use await or then with api, quoteAPI, or other API’s, they will not yield any results, as all parameters within Interceptor Methods are Promises.

Incorrect

export const quotesDetailSubmitPre = async ({ api: { crmManager } }) => { const payload = crmManager.getPayload() console.log(payload) // returns {Promise pending} }

Correct

export const quotesDetailSubmitPre = async ({ api: { crmManager } }) => { const payload = await crmManager.getPayload() console.log(payload) // returns {id: '123', name: 'pricefx Pivo a Párek' ...} }