Sales Fees can have complex rules about when they apply, and those rules often differ by location. This can make managing sales fees on deals a daunting task.
DealerTeam developed a Location Deal Fees component to create various fee options and address complex rules to define when Sales Fees are applied to deals. The component works by writing a JSON string to the Deal Fees (dealer__Deal_Fees__c) field.
After reading this article you will be able to:
- create New Location Deal Fees with definitions
- set flat-rate Fees to be added manually to a deal.
- use the Default Amount by Formula Field
Salesforce has two different desktop user interfaces: Lightning Experience and Salesforce Classic. This article is designed for Lightning Experience.
Before creating a Location Deal Fee take a minute to review the table below to understand the available Fields and their related Descriptions.
|Fee Name (required)||Name of the Sale Fee as displayed on Forms.|
|Fee Description (required)||Description of the Sale Fee as displayed on Forms.|
|Price||Flat rate of the Sale Fee. Will not get evaluated if Default Amount by Formula Field is populated.|
|Default Amount by Formula Field||Formula that can evaluate a value using fields on a deal and other math operations (see Evaluating Formulas with Calculations Fields). If this field returns a Null value then the Sale Fee will not get added to the deal. Must have 2 digit decimal precision.|
|Fee Code||Code for the Sale Fee used for internal communication or integration.|
|Default on Deals||If the deal should always include a Sale Fee set this to True. If the Default Amount by Formula Field is populated then this field is ignored.|
|Taxable||Set to True if the value of this Sale Fee should get taxed.|
Step One: Navigate to the Location Deal Fees
From the App Launcher, type Locations in the quick search. Listed under All Items, click Locations.
Choose the desired Location by clicking the Location Name.
Next, click the tab Location Deal Fees.
Step Two: Create New Location Deal Fee
Each created Location Deal Fee is represented by a row that may get added to a Deal either automatically or manually.
If multiple locations share the same Sales Fees, copy the values of the Location Deal Fees to new locations and the same Sale Fees will be equally available.
To create a new Location Deal Fee click Create New Fee.
Create a Flat Rate Fee to add Manually
To create Deal Fees that your Sales Department can charge at their discretion, simply create a Location Deal Fee with a set value in the Price field and do not select the Default On Deals check box.
To manually add the Deal Fee, navigate to the Purchase Tab on the Deal (1), under the Fees section header click +Add (2) choose Smog Fee from the pick list menu (3) to add the Deal Fee click Update (4).
Create Default Location Deal Fee by Formula
Again from the Create New Fee modal, fill out the required fields Fee Name and Fee Description. In the example, we created a Deal Fee that uses a formula to calculate the Tire Tax.
The formula field must use a two digit decimal to represent dollar amounts. The system will recognize a single zero as NULL and the Sales Fee will not compute on the deal.
The example formula states when the Deal Type is equal to 'R' , add a $50.00 State Tire Tax, or else add $0.00
Default Amount by Formula Field - IF(dealer__Deal_Type__c == 'R', 50.00, 0.00)
Make sure the Default on Deals checkbox is selected and this fee will automatically be added to each Deal Type (R).
When finished entering the details, Click Save.
Working examples for Default Amount by Formula Field
- If the vehicle does not exist on the deal, set value to null(0) else value is $100
|IF(dealer__Vehicle__c == NULL,0,100.00)|
- If the Deal Type is Chassis/Conversion, add fee $250, else set to null(0)
|IF( dealer__Deal_Type__c == 'Chassis / Conversion', 250.00, 0 )|
- If Trade allowance does not exist on the deal OR Trade allowance is equal to 0, add a fee of $33.50 by default, else add a $34.50 fee to the deal.
ISNULL( dealer__Trade_Allowance__c ),
ISBLANK( dealer__Trade_Allowance__c ),
33.50, 34.50 )
- If the deal Type is 'Chassis / Conversion' AND if trade allowance is null or 0 add a fee of 33.5 to a deal
If deal Type is 'Chassis / Conversion ' AND trade allowance is NOT null or 0 add a fee of 34.5 to a deal
If the above examples are not met, return '0' which is considered null and this fee will NOT default on a deal.
dealer__Deal_Type__c == "Chassis / Conversion",
dealer__trade_Allowance__c == null || dealer__Trade_Allowance__c == 0,
NOTE: If the fee is producing unexpected results, for example creating a $0 fee or the fee doesn't show when expected, ensure the custom field API name doesn't match a packaged field without the name_space.