How to Edit Interceptor in Pricefx

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.

Interceptor_Editor_Window.png

How to Add Interceptor Method Template in Pricefx

Prerequisites:

Steps to edit an Interceptor:

  1. In Configuration > Interceptors you will see all available intercepted methods. Each method refers to an event in Pricefx Interceptor Methods. Some of these events are:

  2. As you expand one of the method fields, you will see Add PRE Code, and/or Add POST Code buttons (according to each method’s compatibility):


    When clicking any of them, a modal window will show:

    image-20241002-121106.png


    There is a dropdown menu with available templates, and you can also paste your JavaScript code in there.

  3. Reload the interceptor every time after modifying the interceptor to apply changes.

  4. Finally, you can test the interceptor's functionality, in this case by creating a new quote:

How to Edit Interceptor in VSCode or VSCodium

Prerequisites: Make sure you have the Develop Interceptors role assigned.

For a better user experience during development, we strongly recommend using VSCode with the Pricefx Code extension as IntelliJ offers JavaScript code highlighting only in paid versions of the IDE.

  1. Install and login to the partition in which you want to edit interceptor. Here's how to get it done Pricefx Code.

  2. Open the interceptor you would like to edit.

    image-20241002-123003.png

  3. Save the file after editing is done. A notification should appear and inform that the interceptor was saved.

  4. Reload the interceptor every time after modifying the interceptor to apply changes.

How to Edit Interceptor in IntelliJ

Prerequisites: Make sure you have the Develop Interceptors and General Admin role assigned.

Steps to edit an Interceptor:

  1. Check your version of Pricefx Studio in Plugins and update the version if necessary. If the plugin is missing, install Pricefx Studio first.

     

  2. Edit the Config.js file to be able to fetch and deploy your solution to the correct environment.

     

  3. After creating a new Dynamic Interceptor on the Configuration > Interceptors page, you can fetch it. Select the Environment and Partition that you want to work with and locate your interceptor in the Advanced configuration. Then click the Fetch button.

     

  4. The procedure is similar to deploying your solution after some changes.

     

  5. After the code is deployed, use the Reload Interceptor functionality.