Some time you may get requirement to use price list based on the customer selected in opportunity or order. In this article we are going to provide steps to implement this requirement. If you are new to price list I will suggest you to first go through this KB which will help you to understand price list.
To implement this requirement, mainly we need to do the following two customizations :
- Setup a relationship between account and price list (1:N) and add price list sub grid on account, so that we could add multiple price list to account record.
- Setup dependent lookup in opportunity, to show only price list associated with selected customer
So let’s first setup relationship between account and price list, use following steps:
- Navigate to Settings - Customizations, then Customize the System.
- Navigate to Entities - Account, 1:N Relationship, then New 1 to Many Relationship and provide name for the lookup field like the following screen:
- Save and Close relationship dialog.
- Open Account form under Account - Forms.
- Select any section on account form where you want to place sub grid for price list and click on Sub-Grid button under Insert tab in top toolbar.
- Setup sub grid data source like below and click on Set button.
- Save and Close account form.
We have created three price list and we are going to associate two price list with account. You can refer this KB how to create price list in CRM.
Let's create a new account record or open any existing account record and associate two price list using + sign in price list sub grid and select the following two price lists:
Now we have our price list associated with customer, so let's setup dependent lookup field on opportunity entity to show only price list which is related to account selected in opportunity. Using the following step to configure dependent lookup field:
- Navigate to Entities - Opportunity, then Forms
- Open Opportunity form and double click on Price List lookup
- We need to configure Related Record Filtering like the following.
- Click on Publish All Customization button available on top tool bar to publish all the changes we have done.
Now when we will try to create new opportunity record using our account, it will only show related price list under price list lookup record like the following screenshot: