Using an Expression Builder business object in dues special pricing
The iMIS Expression Builder is a powerful tool within Business Object Designer that allows you to create complex expressions. These expressions can be used in a billing product's special pricing rule for price evaluation.
Requirements & Best Practices
Before you create an Expression Builder business object to be used with dues special pricing, review the following information.
Requirements
To use an Expression Builder business object with dues special pricing, the following are required:
- The Available to screen designer? checkbox is enabled.
- The Available to UI? setting is set to Yes.
- If using the If then else expression and the statement contains the price, it must be set to Decimal.
Best Practices
The following are not required but are suggestions and best practices to consider when creating an Expression Builder business object to be used with dues special pricing:
- If the Data Type is Decimal, then the Length is set to 19 and the Scale is set to 2.
- The Prompt for field setting is updated to match the Property Name. The value entered in the Prompt for field setting is what appears as the display property when this business object is used in a query. By default, the Prompt for field setting is CustomProperty.
- Save the business object often. If you are creating a long rule, be sure to save the business object periodically as you create the rule.
- Test the pricing before generating mass renewals. If the pricing is not correct, verify the expression data.
- See Building Business Objects: Best Practices for additional best practices about building business objects in general.
Examples
Example: Each Canadian province has different tax rates that you must accommodate. Use the if/then/else expression to create the special pricing rules for the different tax rates.
Create the rule in Expression Builder
Do the following:
- Go to RiSE > Business Object Designer > New > Design Business Definition.
- Enter a Name (ProvinceTax), then click Create Object.
- (Database tab) Click the Database tab, then add the following:
- Tables: Name and Name_Fin
- Used Columns: Name.ID
- Joins: Name.ID = Name_Fin.ID (InnerJoin)
- (Properties tab) Click the Properties tab, then click Add Custom Property:
- Name: TaxRates
- Data Type: Decimal
- Length: 19
- Scale: 2
- Click the Save icon.
- (Values tab) Click the Values tab, then choose Value list. Create the value list that will be used to define the taxable options. This step makes it easier to create the special pricing rules later.
- (Expression builder tab) Create the following in Expression builder:
- Click Save, then Publish.
Create the following value list:
Data Value | Display Value |
---|---|
1 | Tax Exempt |
2 | Not in Taxable Country |
3 | Ontario |
4 | Nova Scotia, Newfoundland and Labrador, New Brunswick, Prince Edward Island |
5 | Quebec |
6 | Default Rate |
Create the billing special pricing rule
Do the following to use the ProvinceTax business object in a special pricing rule:
- Go to Membership > Billing products.
- Edit or add a billing product.
- Enable Use special pricing, then select Add new price rule:
- Customer type: Any
- Calculation type: Map exact property values to prices
- Source: ProvinceTax
- Property: TaxRates
- Map the values you created in the Value list to the desired tax rates. For example:
- Continue adding rules that you need, then Save & Exit.
Example: The association offers a $50 discount on your first year of membership. Use the if/then/else expression to create the special pricing rule for first-year member discounts.
Building the discount through Expression Builder
Do the following:
- Go to RiSE > Business Object Designer.
- Click New > Design Business Definition.
- Name the new Business Object, then click Save.
- (Database tab) Do the following from the Database tab:
- Add the Name and Name_Fin tables.
- Add the Name.ID column to the Used Columns.
- Create the following Join: Name.ID = Name_Fin.ID (InnerJoin)
- Click Save.
- (Properties tab) Click Add Custom Property:
- Property Name: FirstYearDiscount
- Data Type: Decimal
- Length: 19
- Scale: 2
- Click the Expression builder tab, then choose If then else from the Expression drop-down.
- Build the following expression:
- Click Save, then click Publish.
Adding the custom property to a billing product
Important! The only billing products that will allow discount (negative) amounts are Miscellaneous Items (MISC).
Do the following to create the billing product:
- Go to Membership > Billing products and select Add new billing product.
- From the Type drop-down, select Miscellaneous Items.
- Enter a Code and Name for the product.
- Click Save.
- Enable Use special pricing.
- Select Add new price rule.
- Customer type: Any
- Calculation type: Use the value of a numeric property as the price
- Source: Business Object you created (FirstYearDiscount)
- Property: Expression Builder property you created (FirstYearDiscount)
Example: Members in specific states qualify for discounted membership dues. Use a standalone panel to define the states and the correlating prices, then connect the standalone panel to a custom business object property.
Creating the standalone panel
Do the following to create the standalone panel:
- Go to RiSE > Panel Designer > Panel definitions and select Add panel definition:
- Panel name: State Pricing
- Parent type: Standalone
- Click Create source and enter StatePricing as the Source name.
- Add two properties to the new source:
- Property type: Text
- Pre-defined values: Enabled
- Defined by: Source table
- Source: State
- Property type: Integer
- Drag the properties to the grid, then Save & Exit.
Property | Configurations |
---|---|
State |
|
Price |
|
Adding countries and pricing to the panel
Do the following to add the panel to a content record and populate the table:
- Go to RiSE > Page Builder > Manage content and create a new content record (New > Website Content).
- Give the page a Title the content, then select Add content.
- Open the Content folder, then choose the Panel Editor content item:
- Title: State pricing for membership dues
- Panel: State Pricing
- Allow users to add, Allow users to delete, Allow users to edit: Enabled
- Click OK, then click Save & Publish.
- Go to RiSE > Site Builder > Manage sitemaps and choose the Staff site from the drop-down.
- Click Membership, then click New > Website Navigation Item:
- Navigation link text: State Pricing
- Content or URL to link to: Content record you created in step 1.
- Click Save then Publish.
- Go to Membership > State Pricing and populate the table with the appropriate state pricing rules.
Adding the standalone panel property to a Business Object
Do the following to add the standalone panel as a property in Expression Builder:
- Go to RiSE > Business Object Designer and click New > Design Business Definition.
- Enter a Name, then click Create Object.
- Click the Database tab.
- From the Tables section, click Add.
- Add the Name and StatePricing tables.
- From the Available Columns section, add the Name.ID and StatePricing.Price properties to the Used Columns section.
- From the Joins section, add the following join: Name.STATE_PROVINCE = StatePricing.State
- Click Save, then click Publish.
Adding the custom property to a billing product
Do the following to add the expression builder property to a billing product to be used for price evaluation:
- Go to Membership > Billing products.
- Open the billing product for edit, or create a new billing product.
- Enable Use special pricing.
- Select Add new price rule:
- Choose a Customer type.
- (optional) Choose a Billing category.
- From Calculation type, choose Use the value of a numeric property as the price.
- Select Add source.
- Choose the Business Object you created in the previous section (PricingPerState).
- From the Property drop-down, select Price.
- Click OK, then click Save.