Pricefx Classic UI is no longer supported. It has been replaced by Pricefx Unity UI.
Add New Calculation Logic
To create a new calculation logic (which is applied at the line item level):
- Go to Configuration > Calculation Logic > Generic Logic.
- Click the Add icon.
- Enter a Name and a Label (optional).
- Enter a Valid from date. The validity date can be entered manually or via the date picker .
Multiple calculation logics can have the same name but different validity dates. For price calculations the logic will be selected based on the Valid From date relative to the Target Date. - Select a Status from the drop-down menu:
- Inactive – Default for a new calculation logic. The logic will not be used in price calculations.
- Active – The calculation logic will be used in the price calculation. When more than one logic with the same name has the status ACTIVE, the logic that is valid on the selected 'Target Date' will be used (see higher).
- Simulation Only – The calculation logic will only be used in simulations.
- Enter a Nature of the calculation logic:
- Inline Details View – Defines the inline details for product-, customer master or product- and customer extensions.
- Customer Input Filter – Determines which customers are available for the user to select.
- Quote Entitlement Filter – Determines which quotes the user will be able to see and edit. See the details below.
- Agreement/Promotion Entitlement Filter – Determines which Agreements/Promotions the user will be able to see and edit. See the details below.
- Rebate Agreement Entitlement Filter – Determines which rebate agreements the user will be able to see and edit. See the details below.
- Matrix – The logic is used for Matrix-Price lists (price lists with two keys).
- Creation Workflow – Allows more users to cooperate on document creation.
- Workflow Delegation User Filter – Determines to which users the user is able to delegate their approval rights.
- Product Input Filter – Defines a custom filter for the Product and Product Group pickers which are used throughout the application. Specifically for Quoting, there is another option to set up a product filter; see Quote Product Filter Logics.
- Click the View/Edit Details icon to configure the calculation logic. A new window will open.
In order to be able to calculate a price, each product must be linked to a calculation logic (defined in the product master). A default logic can be chosen from the drop-down menu Select pricing method.
Details on Entitlement Filter Logics
Logics of the 'Entitlement Filter' Nature are intended to assess which Quotes/Agreements/Promotions the user will be able to see in detail and edit.
Requirements for the logic:
- Its Nature must be set to Quote Entitlement Filter or Agreement/Promotion Entitlement Filter or Rebate Agreement Entitlement Filter.
- It needs to be set as Active.
- It needs to have one or more elements where each one returns a Boolean value (a result or a decision).
- Only when all elements return true, the user is allowed to view/edit details of the quote.
- To satisfy all these requirements, you can read data from the underlying Quote/Agreement/Promotion and from any API call (e.g. api.user() to get the current user). It is then expected that a Boolean check will be the result of the decisive logic element.
- In the quote logic, a quote for which the check happens is available as a quote variable (similarly as in the workflow logic).
For example, there might be just a single element:
quote.additionalInfo4 == "blue"
which will allow only quotes with additionalInfo4 == "blue" to be opened.
For any check depending on other data stored elsewhere, you should always keep in mind that it is desirable to avoid any complex logic/fetches from the database. Ideally, you should never need more that a single api.find call to check if some data that grants a user the access to quote details or not.
The following example
def result = api.find("CX30", 0, 1, null, Filter.and(Filter.equal("name","myCXTable"), Filter.equal("attribute1", contract.inputs[0].value))) return result != null && !result.isEmpty()
will try to find up to 1 record which respects the filter. Projects with high data volumes and on dedicated instances should check whether they might need indexes on the fields used for filtering.
Which Logic will be Used for Calculation?
There can be many pricing logics defined and they can be associated with:
- Specific product (on the Product page),
- Object (Price List, etc.),
- and then there is the general Default logic.
For calculations, the system will always use the first applicable logic (in the order given above). If a header logic is defined, an order of execution applies.
Found an issue in documentation? Write to us.