Dynamic Field Formulas for Price Books

General

To work, price books require dynamic field formulas that the admin user must set.

Row List Price field:

{$product_id|get_pricebook_price:$account_id} {$product_id|get_pricebook_price:$account_id:”OPTIONAL_PB_TYPE”}

Example: Checking if the Account has a price book price

There are several different use cases for Price books, for which different dynamic field formulas can be made. Below is an example of how to check if the Account has a Price book price. The example formula below works in modules that use the field Row Unit Price (e.g. Invoices and Sales Orders).

Dynamic field formulas used to manage price books can be modified according to their intended use. The formula below is used to check whether the customer has a price book price:

{if $row.product_id && $account_id}{assign var="PB" value=$row.product_id|get_pricebook_price:$account_id}{else}{assign var="PR" value=$row.listPrice}{/if}{if $PB}{$PB}{else}{$row.listPrice}{/if}
  • First, we check that the entity in question contains both a product and a customer in the row.
  • Next, a variable is defined, which is used to check whether the company has a price book price or whether the basic list price of the product is used.
  • The variable in the example symbol is PB, i.e. the Price Book module is referred to here.

Example: Creating a dynamic formula for a selected usage

Dynamic field formulas are managed from the settings under Module manager, where the settings of the desired module are then selected. Then we add a new formula as follows:

  1. Dynamic field formulas are selected
  2. A New formula is selected
  3. Write the desired formula and press Save
  4. Once the formula is saved, it must be activated from the formula control panel. Disabled formulas appear in the formula list with a red background.
  5. When the formula is active, its background turns white and it can be viewed and edited from the formula’s own control panel if necessary.

An example of editing a formula

If, for example, you would like to use several price lists, you can also use the type of price list. This would be added as part of the above formula as follows:

{$row.product_id|get_pricebook_price:$account_id:”OPTIONAL_PB_TYPE”}

Example: Getting tax percentage from the price books

For different reasons customers may have different tax for same products. You can always fetch the customer-specific tax rate from the price book, just like you can fetch customer-specific prices from the price book. This can be done by writing the formula in the tax field of the row. The customer-specific tax percentage can be retrieved from the price book using the following dynamic field formula:

{if $account_id}{$row.product_id|get_pricebook_tax:$account_id}{/if}
Was this article helpful?

Related Articles