Posted on by Todd Miner

One of the newer features packed into Apptivo’s V6 technology are Function Attributes.  These attributes allow you to create custom calculations based on the values of other fields, and display this calculation anywhere on the page that you’d like.  In this article we’ll cover some example scenarios where functions can be used, walk through the common settings, and give a step-by-step walk through of creating a sales commission field on a CRM opportunity app.

Click here to watch a short video on how to track opportunity sales commission with the function attribute.

Example Usages of Function Attributes

Every business has unique processes, so these are just a few examples that might provide some ideas on what custom calculations would make sense for your system.

  • Calculating Sales Commission – Display a field which calculates a commission value based on the amount of a deal.
  • Generating Price Per Square Foot – A real estate agent can input the size & price of a property, and a formula can generate the per foot value.
  • Determining Profit Margins – You might want to include a field to track the cost of a product, and then create a function attribute to print the overall profit & margin.
  • Applying Special Fees- A standard late payment fee feature exists, but a company might have a special fee for certain types of invoices, and a formula could automatically apply it.
  • Converting Measurements – International companies might want to input all measurements in metric, but also display the converted imperial values automatically.

How a Function Attribute Works

The general settings around field label, visibility, etc all exist for function attributes.  It acts like any other text field or dropdown you might add, except that the value is automatically calculated, instead of allowing a user to enter.  The two key settings are the formula itself, and the digit output settings which format the result of the formula.

Digit Output Settings

  • Type – Either a plain number, or currency to show a financial figure.
  • Currency Code Source – If using multi-currency, you can select the currency for the business, or from another currency field.
  • Scale – The number of digits after the decimal point.  For a currency we’ll usually set “2” for including cents, and “0” for whole numbers.
  • Rounding Mode – Allows us to round the number.  It’s common to round to nearest and set a scale of “0” for things like commission calculations.

Custom Formula Editor

Inside of the formula editor you have both Simple and Advanced tabs, we’ll cover just the simple formulas in this article.  Here, you’ll be able to select from any other number or currency field from the master layout, and use it as a part of your formula.  You can also perform common mathematical functions, and manually input any numbers desired.

The end result of the formula will be calculated whenever a record is created/updated, and displayed based on the rules of your digit output settings.

Example – Sales Commission for Opportunities

In this example we’ll add a field that calculates what sales commission can be expected for an opportunity.  We’ll take a simple approach of calculating 3% of the deal amount.

  1. Navigate to the Master Layout page of settings under the Customize App section
  2. Click on the “Function” button under “Attributes” in the right panel, drag to the desired location for your new field.Adding a Custom Function
  3. Once created, the new field is called something like “Function 1” by default.  Now click once on the field to edit it.
  4. Now the field details appear on the “Inspector” tab in the right panel.  Change the name to “Sales Commission”.Changing Field Names
  5. Scroll down the inspector tab to “Digits”, and set values for each field.  For this example we’ll set to Currency, use the currency from the “Amount” field.  Then for the output of the field, we want to round to nearest, and set a scale to 0 so we get a clean whole number.Customizing Number Fields
  6. Scroll to the bottom of the inspector tab to find the “Function” section, and click “Create Function”.Writing a Custom Formula
  7. This opens the “Function Editor” popup, start by clicking on “Insert Attributes”, then selecting the opportunity amount field.Insert Attribute in Formula
  8. You can either type, or use a button in the operator toolbar to input * to multiply.
  9. Now we’ll just type in either .03 or 3% to complete the custom formula, and click “Create”.Operators in Formulas

The end result is that our Sales Commission field appears on each opportunity, and you can see it automatically created a nice round commission figure for us!
Custom Sales Commission

Summary

So that’s one quick example of a function, but there are many other ways to make this feature more powerful.  You can start to introduce more advanced options by combining custom fields, and conditional rules.  For example you might want to have 1 separate field for “Commission %”, which is calculated based on another formula or some other criteria.  Then use this commission % as an input to your main calculation, allowing you to award a different commission amount for different employees or types of deals.

So get out there and let us know what cool combination you can come up with!  As always, just ping our friendly support team should you need any assistance.

Leave a Reply