TECH SUPPORT

User Defined Constants

Follow

 

 

 

 

The User Constants module is accessible from the Advanced Toolbar and from the "New..." dropdown item for the @@User Defined Constants in the Insert Function. This module allows you to create your own constants using your own formulas.

 

You can use the Insert Function to enter other constants such as the SQL-RD Constant for the CurrentDateTime above.

 

From the initial screen, you can search and for an existing constant with the option to include the definition of the constant in the search. The matched constants are updated as you type.

 

Click the Add button to bring up the Formula Editor.

 

 

Formula Name: The name of the constant.

Definition: The definition of the formula.

 

Click the Save Button to save a defined constant.

 

 

 

This will then be available for use under the @@User Defined Constants name in the Insert Function. Please click here for more information.

 

To delete a User Defined Constant, select the formula name from the dropdown and click the Delete button.

 

 

Click Yes to confirm deletion.

 

User constants allow you to compose and create your own set of constants. This can be useful in reducing the amount of work you would need to do. For example, if you have to use several constants to create a report name following a naming convention that is in use in your organization you can create a single User constant that combines these in the format you require and use this constant instead.

 

Inserting User Constants

 

To insert a user constant, use the inserts feature where available. Select User Constants, then simply drag and drop your desired constant to the desired field.

 

 

 

User Functions

 

Specific functions can be called programmatically via User Constants. This means that certain values can be created or manipulated based on these functions.

 

For example, you wanted a generated report's file name to be created with an incremental number. Using a function this can be accomplished. Simply write the function that would increment the number. Save this user constant for later use. Finally this user constant can be inserted into the customized report file name via the user constant.

 

Below are a list of various functions that can be called:

 

To call a function, create a User Defined Variable. Click on User Constants, and click Add to add a new constant. You can also add a User Constant from the Inserts Window.

 

 

In the Add Constant Window, ensure that “Evaluate functions in definition” is checked. In the Definition window, enter the desired function(s). You may test the function by clicking on the Test button. The functions results will appear in the lower window.

 

When finished, click OK. The function will be added as a selectable insert. You can then drag and drop the function into the software’s various fields.

 

Available Functions

 

Function Name: DECRYPT

Use: Decrypt a string

Returned Value: String

Parameters: AString,

Sample: DECRYPT(‘SOME STRING’)

Function DECRYPT(ByVal AString As String) As String

       

 

Function: ENCRYPT

Use: Encrypt a string

Parameters: AString

Returned Values: String                    

Sample: ENCRYPT(‘SOME STRING’)

Public Function ENCRYPT(ByVal AString As String) As String

 

Function: GETGUID

Use: Get an ID value

Returned Values: String

Sample: GETGUID(‘SOME STRING’)

Function GETGUID() As String

 

Function: DATEDIFF

Parameters: String, DateTime, endDate

Returned Values: Double

 

  Function DATEDIFF(interval As String, startDate As DateTime, endDate As DateTime) As Double

 

Function: REPLACE

Use: Replace a value

Parameters:  inStr as String, find as string, replacevalue as string

Returned Values: String, instr.replace

Function REPLACE(inStr As String, find As String, replaceValue As String) As String

 

Function: SIN

Parameters: ByVal, As Double

Returned Values: As Double, Math.Sin

Function SIN(ByVal v As Double) As Double

 

Function: NOW

Returned Values: DateTime

 

Function NOW() As DateTime

 

Function: TODAY

Returned Values: DateTime

    Function TODAY() As DateTime

 

Function: RND

Use: Round Integer

Returned Values: Integer

Function RND() As Integer

 

Function: RANDOM

Use: Get random integer

Returned Values: Integer

 

Function RANDOM() As Integer

 

Function:  MATTER

Returned Values: Matter

 

Function MATTER() As Matter

 

Function: MID

Parameters: VyVal str as String, ByVal index as Double

Returned Values: String

 

    Function MID(ByVal str As String, ByVal index As Double) As String

 

Function: SUBSTRING

Parameters: ByVal str as String, ByVal index as Double, ByVal len as Double

Returned Values: CInt (index), CInt(len)

Function SUBSTRING(ByVal str As String, ByVal index As Double, ByVal len As Double) As String

 

 

Function: LEN

Parameters: ByVal str as string

Returned Values: Microsoft.VisualBasic.Trim(str), String

 

    Function LEN(ByVal str As String) As Double

 

Function: TRIM

Returned Values: Microst.VisualBasic.Trim(str), String

Parameters: ByVal str as string

Function TRIM(ByVal str As String) As String

 

Function: IFN

Returned Values: TrueValue, FalseValue, as Double

Parameters: ByVal cond as Boolean, ByVal TrueValue as Double, ByVal FalseValue as Double

Function IFN(ByVal cond As Boolean, ByVal TrueValue As Double, ByVal FalseValue As Double) AsDouble

 

Function:  IFD

Returned values: TrueVlaue, FalseValue, as Date

Parameters: ByVal cond as Boolean, ByVal TrueValue as Date, ByVal FalseValue as Date

Function IFD(ByVal cond As Boolean, ByVal TrueValue As Date, ByVal FalseValue As Date) As Date

 

Function:  IFS

Returned Values: TrueValue, FalseValue, String

Parameters: ByVal cond As Boolean, ByVal TrueValue As String, ByVal FalseValue As String

Function IFS(ByVal cond As Boolean, ByVal TrueValue As String, ByVal FalseValue As String) AsString

 

Function: FORMAT

Parameters: ByVal value As Object, ByVal style As String

Returned Values: String, Microsoft.VisualBasic.Format(value, style)

Function FORMAT(ByVal value As Object, ByVal style As String) As String

 

Function: UCASE

Parameters: ByVal value As String

Returned Values: Microsoft.VisualBasic.UCase(value), string

Sample:

Function UCASE(ByVal value As String) As String

 

Function:  LCASE

Parameters: ByVal value as String

Returned Values: Microsoft.VisualBasic.LCase(value), String

Function LCASE(ByVal value As String) As String

 

Function: WCASE

Returned Values: Microsoft.VisualBasic.UCase(value.Substring(0, 1)) & _ Microsoft.VisualBasic.LCase(value.Substring(1)), String

Parameters: ByVal value as String

 

Function WCASE(ByVal value As String) As String

 

Function:    Function [DATE](ByVal year As Double, ByVal month As Double, ByVal day As Double) As DateTime

Parameters: ByVal year As Double, ByVal month As Double, ByVal day As Double

Returned Values: DateTime, New Date(CInt(year), CInt(month), CInt(day))

 

Function [DATE](ByVal year As Double, ByVal month As Double, ByVal day As Double) As DateTime

 

Function: INT

 

Returned Values: Double, Microsoft.VisualBasic.Int(value)

Parameters: ByVal value As Double

 

Function INT(ByVal value As Double) As Double

 

Function: Function ROUND(ByVal value As Double) As Double

Parameters: ByVal value As Double

Returned Values: Double, Math.Round(value)

 

Function ROUND(ByVal value As Double) As Double

 

Function:  DateOpened

Returned Values: DateTime

 

Function DateOpened() As DateTime

 

Function: UnpaidBil

Returned Values: Double

Parameters:

Sample:

Function UnpaidBill() As Double

 

Function: FINDNUMERICVALUE

Use: Find a set of numbers at a specified position

Parameters: inStr as String, index as Double

Returned Values: String

Sample: FINDNUMERICVALUE(‘0000, 2’)

Function FINDNUMERICVALUE(inStr As String, index As Double) As String

 

 

 

 

Comments