Along the same lines as my previous article covering referencing entities using the IDynamicEntity interface to set and get properties by a string name instead of as a strongly-typed object, you can also use the IComponentReference interface as a generic entity type since all entities implement this interface. This interface is found in the Sage.Platform.ComponentModel […]
There might be times when you need to set an entity property value by the property name as a string at runtime. Sure, you could use reflection for this and use the PropertyInfo class, but there is a built-in way that is much easier to use. All entities implement the IDynamicEntity interface, which provides this […]
When using IQueryable to look for records within an Entity collection you will likely run into an error at some point when trying to add a condition to search for when that condition is a related entity property, or is a calculated entity property. For instance, lets say we have the Sales Order entity that […]
Using external assemblies in SalesLogix development, rather than built in Code Snippets, is a better & more efficient way to customize SalesLogix entities, with far less headaches. Some of the benefits include a better and more complete development environment and having all your code in one place (instead of digging around through all the entities to get to the code). Let's take a look at how to do it.
For some who have been working in the SalesLogix LAN client for years, the transition from using SQL queries to retrieving data using a repository with the entity model can be a difficult change. This post will look at some common data retrieval methods and the SQL equivalents to help you get your head around how to get work done using the entity model.
The SalesLogix entity model offers a really great way of working with data in SalesLogix and letting the system establish all of the links for you- as long as you know what you are doing. One of the really great things that you can do is to add child entities to a parent, even if the parent is not yet in the database. This is especially helpful if you need to create child records while still on an insert screen.
I have not found any official reference to this change anyplace: prior to 7.5.2 the Sage.Entity.Interfaces.IOwner entity contained a RightsCollection collection of user rights (Sage.Entity.Interfaces.IOwnerRights which represents the database table SECRIGHTS). In 7.5.2 this has changed to now just be called Rights. If you have any code that was using the previous property name “RightsCollection” […]
It is useful at times to be able to programatically determine at runtime if a user has read access, write access, or no access to a particular field at runtime. There are many different ways this information can be used to ensure you're giving the current user the best, and most understandable experience based on that particular user's security settings allow for. Luckily, with the introduction of the FieldLevelSecurityService in SalesLog...
One of the keys to reusing a form for both inserting new records and displaying existing record detail is the ability to determine if the form is currently in insert mode or detail mode. There are several ways to determine this at runtime so you can take the necessary steps depeding on the current form mode.
Five years ago I wrote a post about how to determine if a user is a member of a team in SalesLogix LAN scripts that is still referred to today. I've been asked on occasion how one would go about doing the same in the SalesLogix Web platform, so I thought it was time for a follow up post. In this post I will demonstrate how to use a HQL query to create a reusable function in the SalesLogix Web platform to determine whether a user is a member o...
There are likely many cases in SalesLogix Web where you need to access properties on the User and Security related entities that are not included in the entity by default, meaning that there is no public property exposing the value. For example, the IsManager property on the User entity. Modifying these entities won't work, so how do you get to these properties? This post provides an explanation of why you can't modify these entities and ...
Something that is a common task in development, yet one that I get a lot of questions about, is how to programatically add a new record in SalesLogix Web using the entity model. This is an easy task, but unless you have some examples to learn from you might not know where to start. Let’s […]
There are many ways to get the "current" account in SalesLogix Web. For those coming from developing for the SalesLogix Windows client, you'll likely want the same capabilities that the BasicFunctions CurrentAccountID provides. In the web platform, however, there is all of that, plus more.
One of the best things about working with the SalesLogix 7.2 Web application is how great the entity model is. You have this single place to put all your rules and logic, the UI is really just an afterthought. Something that I do quite often is create business rules to return data specific to an entity instance. For example, a rule to return the primary contact for an account. Let's take that a step further and return a list of objects from a...
A change was introduced in 7.2.2 regarding custom properties. This post looks at this change and revisits the earlier topic of placing a link to an account's primary contact on the account details form.
I posted before about getting previous values for entity properties in SalesLogix Web. The method I used in that post made use of IEntityState to get the changes for an entity. In SP2 (version 7.2.2 - currently in release candidate as of the time of this post) IEntityState is now obsolete. It has been replaced by Sage.Platform.ChangeManagement.IChangedState. All SalesLogix entities now implement this interface.
Field change tracking is implemented in a great way in SalesLogix 7.2 Web. You select the entity you want to track field change history to and then select the fields to audit. It's that simple. You can also easily create your own custom tracking tables to record field changes to so you don't have to overload the history table with all the tracked field changes.
When a field is changed in the 7.2 web client, you often will find scenarios where you will have business rules that need to validate the change and possibly change it back to whatever it was before. Checking the property on the entity, you'll find it is too late. The property will already show the new value it was changed to. Fortunately, the 7.2 platform maintains state for all entities, so it is possible to easily retrieve the previous val...
In the SalesLogix 7.2 Customer Portal, you might have the need to get or set values from the user's contact record. While the user is actually a contact, in the portal, the SLXUserService is still used to get the logged in user, however, you'll need to translate to an IContact to work with the underlying contact record.