Examples of VB.Net, C#, and JSON code for the Encompass® platform

I am looking to find ways to share VB.Net, C#, and JSON code to those who need it. This post gives examples of each. If you are interested in learning more, let me know.

https://www.workflowpartners.org/contact

Larry B.

'Here is an example of VB.Net for a Field Trigger business rule.
  
IgnoreValidationErrors


If [1811] = "PrimaryResidence" or [1811] = "SecondHome" Then
	If [#16] = 1 Then
		If [#1821] <= 1000000 Then
			[641] = 450.00
		Else If [#1821] > 1000000 and [#1821] <= 2000000   Then
			[641] = 650.00
		Else If [#1821] > 2000000 Then
			[641] = 750.00
		End If
	Else If [#16] >= 2 Then
		If [#1821] <= 1000000 Then
			[641] = 650.00
		Else If [#1821] > 1000000 and [#1821] <= 2000000   Then
			[641] = 750.00
		Else If [#1821] > 2000000 Then
			[641] = 850.00
		End If
	End If
Else If [1811] = "Investor" Then
	If [#16] = 1 Then
		If [#1821] <= 1000000 Then
			[641] = 650.00
		Else If [#1821] > 1000000 and [#1821] <= 2000000   Then
			[641] = 750.00
		Else If [#1821] > 2000000 Then
			[641] = 850.00
		End If
	Else If [#16] >= 2 Then
		If [#1821] <= 1000000 Then
			[641] = 750.00
		Else If [#1821] > 1000000 and [#1821] <= 2000000   Then
			[641] = 850.00
		Else If [#1821] > 2000000 Then
			[641] = 950.00
		End If
	End If
End If

//This is an example of C# taken from our course teaching you how to
build a Nonmodal plugin


private void CurrentLoan_FieldChange(object source, EllieMae.Encompass.BusinessObjects.Loans.FieldChangeEventArgs e)
        {
            // below is a simple way you can write your own messages into the
            // Encompass log file.
            ApplicationLog.Write("NonModal Popup Plugin", "A loan field is changing " +
                " new value is '" + e.NewValue + "' and the old value is: '" + e.PriorValue + "' ");

            string nameFieldId = "CX.NONMODAL";

            // naming our restrictions allows our code to be more readable
            bool isNameFieldChanging = nameFieldId == e.FieldID;
            //bool isNameFieldSetToTest = e.NewValue.Equals("the Input Form Name", StringComparison.OrdinalIgnoreCase);

            // with the named conditions in our if statement, it's very intuitive what
            // the intent of our if statement is.
            //
            // As opposed to looking something like this:
            //
            // if (nameFieldId == e.FieldID && e.NewValue.Equals("test", StringComparison.OrdinalIgnoreCase))
            //
            if (isNameFieldChanging)
            {
                // Open the input form which is identified in the custom field cx.nonmodal, as a non-modal form.
                OpenNonModal(e.NewValue);
            }
        }

'This is an example of a JSON package used in Encompass® on the Web'

[{"name":"Condo Review","description":"","tags":
  [{"name":"Condominimum"}],"comments":"Blah Blah Blah","status":"Active","contents":
  [{"id":"31701a5a-9952-41fd-91f6-4b994a2c26c4","name":"Property, Title and  Trust Information","type":"Standard Form","actions":"Edit"},
   {"id":"8edfc7e7-075f-42aa-b433-ddde7af12e29","name":"Subject Property","type":"Standard Form","actions":"Edit"},
   {"id":"cb89a958-d2b2-46c8-a2bb-4cde93848505","name":"Appraisal","type":"Document","actions":"Edit"},
   {"id":"332b05be-e3a0-4305-bbe1-4ffcc7190bcf","name":"Appraisal Review","type":"Document","actions":"Edit"}],
  "workspacePanes":"2","workspacePaneSettings":
  [{"id":"1cc452cf-add9-451c-84cc-b86b65913699","name":"","content":"31701a5a-9952-41fd-91f6-4b994a2c26c4"},
   {"id":"20352182-c5c2-4100-4867-af5bbee29266","name":"","content":"cb89a958-d2b2-46c8-a2bb-4cde93848505"}],
  "lastModified":"2023-04-17 17:23:19.879 PM UTC","created":"2023-04-17 17:23:19.879 PM UTC",
  "createdBy":"Administrator, Johnny","modifiedBy":"Administrator, Johnny","actions":"Edit","tagList":"Condominimum"}]
Previous
Previous

Why learning something every day is important

Next
Next

Running two versions of Encompass® at the same time on the same PC