Help & Support
Contents
Display Legacy Contents

Search:

Home > Impact Suite > Math > Creating Math Formulas

Creating Math Formulas

Click the Create Formula button to start a formula


  1. Fill in the name for the formula
  2. Pick the field that will receive the result of the formula
  3. Make sure the Active check box is checked
  4. Set the order applied.  This is what order the formula is executed in.
  5. When set to true this will skip math formula when the results field contains data
  6. Select the table the field will come from
  7. Select the type of field
  8. Add the field by double clicking the name or highlighting the field and clicking the Add Selected Field as Cursor button
  9. Add any operative signs ex (+, -, /, *)
  10. Click the OK button when done

 

The buttons at the bottom of the screen will add in generic snippets of code to help you get started.
If/Else: gets you started comparing different fields replace field_a and field_b with the field names to compare
Date Difference: will return the difference between two dates
Replace Fields: replace a field in the database with a field passed to the math formula
Parameters: Shows the parameters passed by the form and that can be accessed in the math formula
If/Else Date: gets you started comparing two dates
Line Numbers will put line numbers in the text area



'-----------------------------------------------------------------------
' This math function automates the ID/Status field based on attached opportunities
' You could set the math function to 'Run on schedule' say at 2am every night 
'-----------------------------------------------------------------------
try
'-----------------------------------------------------------------------
' Does the contact have ANY opportunities?
' If there is more then Zeror set the ID/Status field to CUSTOMER
'-----------------------------------------------------------------------
if HostApplication.ApplicationState.CurrentContact.GetOpportunities(nothing, nothing).Count > 0
Return "Customer"
else
Return nothing ' Returing nothing causes no change to the 'Result Field'
end if


catch ex as exception
' Something went wrong - display a message to the end user
System.Windows.Forms.Messagebox.show(ex.message)
end try



See also



Properties
Article ID:
creating_math_formulas
Views: 330
Created By: jimdurkin
Modified By: [Modified By]
Created Date: 3/24/2014 12:31 PM
Last Modified: 3/24/2014 1:47 PM
Actions
Print This Article
Bookmark
Email This Article
Previous Article
Next Article