To sum the results of a criteria collection you can use code such as the following, which gets the sum of all ticket activities for a ticket: Sage.Platform.RepositoryHelper<Sage.Entity.Interfaces.ITicketActivity> repository = Sage.Platform.EntityFactory.GetRepositoryHelper<Sage.Entity.Interfaces.ITicketActivity>();  ...
In the SalesLogix web client, you don't really have the same old options regarding Queries and Datasets. However, by using IRepository you can create similar functionality by using projections to define groups and other calculations.
One of the other things that you can do with the IRepositroy collection in SalesLogix is to perform a summation of a entity field after filtering for a group of records. Lets look at how to do this: Sage.Platform.RepositoryHelper<Sage.Entity.Interfaces.IOpportunity> repository = Sage.Platform.EntityFactory.GetRepositoryHelper<Sage.Entity.Interfaces.IOpportunity>(); Sage.Plat...
I recently ran into a case where I had to query an Entity in SalesLogix to find records where a user was in any one of three fields. ICriteria has an Or operand but that is for comparing only two fields. So how do you do three? With Disjunction. Here is an example: Sage.Platform.RepositoryHelper<Sage.Entity.Interfaces.IAccount> […]
I wanted to share a quick little method I found the other day in the Sage.Platform.EntityFactory assembly that allows you to retreive the first instance of a record in a SalesLogix entity repository. Normally if I wanted to find the first record in a repository I would use something like IRepository and IQueryable like so: […]
Using IRepository in the SalesLogix web client can allow querying the SalesLogix entity model directly, similar to how you used to query the database directly using T-SQL queries. Ryan has already created a great post here about this, and I expanded on that here. Today I want to talk about one more functionality of the IRepository, that is how to use Projection to return a distinct list of records from your query.
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.
In SalesLogix you can use the Sage.Platform.Repository.ICriteria class to query the entity model using standard ICriteria. One thing I have been asked in the past is how do you exclude certain conditions? A common example might be show me all of the non-closed tickets for a contact, where being closed is denoted by a status=”Closed”. […]