Overview
Custom dues formulas are a good option for calculating one or more line items on a membership when an association's dues calculations go beyond the calculations built in to GrowthZone. Similar to the functionality in GrowthZone, custom dues formulas use data (almost always numbers) from custom fields tied to a membership type to calculate a price for a membership line item using C# code. Several sample formulas are attached to this article.
Adding Formulas
You can add a custom dues formula to a membership type line item or a membership level line item. First, open the pricing modal for a membership type or level.
- Make sure Formula Based Pricing is enabled
- Click on the calculator icon between the Price and Annual Amount columns
- Click on the Script Builder/Tester button in the bottom-left of the Edit Formula modal
- You're now ready to add your formula to the Custom Formula Script text box (Note: this text box is only editable if you are a T1 user and have your User Settings set to In Development.)
Formula Basics
The Edit Custom Formula modal lists every custom field tied to the membership type. Before beginning, ensure that all custom fields needed for the calculation are tied to the membership type.
The Custom Formula Script text box lists out identifiers for every custom field attached to the membership type. Use these to reference data from the custom fields when writing your formula. The text box also contains a sample line of code to send the calculated formula to GrowthZone. You must set the Price variable with the calculated dues.
Testing Formulas
The Edit Custom Formula modal lists every custom field tied to a membership type and provides an input field for each custom field. You can test the formula you've entered in the Custom Formula Script text area by entering values for the custom fields and clicking the Test Formula button at the bottom of the page. You will either see a successful calculation appear at the bottom of the page or an error with your formula.
Success:
Error: