Custom Calculated Entity Properties

The SalesLogix entity model offers the ability to create a custom property underneath an entity.  This can be useful for automatically rolling up things like the Opportunity Sales Potential or calculating fields such as the Opportunity Weighted Average.  To add an custom entity property, expand out the VFS…Entity Model…Packages…SalesLogix Application Entities.  Right click on properties and choose New Code Snippet Property.

SalesLogix Custom Entity Property

The new custom property dialog will open.  First, you need to name your custom property.  For my example we will use something nondescript, "LookupValidation".  You should choose a better name in a real world situation.

The next step is to determine the data type our code system will return.  The default is a String but you can choose from others if appropriate.  Some data types are not listed.  If they are not you can simply just type it in .  Make sure you use the fully qualified name "System.".

SalesLogix Custom Entity Property Naming 

Now that those have been established you can click the Add Hyperlink next to the Steps label.  I am going to add a new C# snippet and select that choice.

SalesLogix Custom Entity Property New Rule Step 

Once I click OK I can now see my step in the step dialog.  Now I will click the Edit Code Snippet hyperlink to actually modify the code and build my custom entity.

SalesLogix Custom Entity Property with a step

The code editor opens with the skeleton of my custom property already built based upon the parameters I used to set up my property:

SalesLogix Custom Entity Property Code Shell

We replace the commented out line shown above with our code.  In my case I want to check to see if the Account is a Customer or Prospect.  To do that I can add the following code:

            if (account.Type.ToLower() + "" == "customer" | account.Type.ToLower() == "prospect")
                result = "Passes";
                result = "Fails";

So there you have it a complete custom entity property.  Obviously this is a very simple example but this can be a vary powerful feature. 

Now be aware that custom entity properties are currently only useable within the web interface.  They are also not available for use in merge documents or groups.


Kris Halsrud

Kris Halsrud is a Senior Analyst / Developer for Customer FX Corporation.

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Join our mailing list to receive the latest Infor CRM (Saleslogix) and Creatio (bpm'online) news and product updates!

You have Successfully Subscribed!