Login / Register  search  syndication  about

          Infor CRM Questions & Answers

Your place to get answers to your SalesLogix related questions.

 Home  |   Subscribe via RSS  |   Subscribe via E-mail  |   

Compiling a C# DLL to Populate a Datagrid in SalesLogix v7.5.1

Question: I am compiling a C# dll to populate a datagrid in SalesLogix v7.5.1.  I would like to include the Assigned to, but it is unable to resolve the property AssignedTo.OwnerDescription.  Here is my code:
 
Sage.Platform.RepositoryHelper rep = Sage.Platform.EntityFactory.GetRepositoryHelper();
Sage.Platform.Repository.ICriteria criteria = rep.CreateCriteria();
criteria.Add(rep.EF.Eq("Contact", contact));
criteria.SetProjection(rep.PF.ProjectionList()
.Add(rep.PF.Property("TicketNumber"))
.Add(rep.PF.Property("StatusCode"))
.Add(rep.PF.Property("CreateDate"))
.Add(rep.PF.Property("CompletedDate"))
.Add(rep.PF.Property("UrgencyCode"))
.Add(rep.PF.Property("AssignedTo.OwnerDescription"))
.Add(rep.PF.Property("Account.Account"))
.Add(rep.PF.Property("Subject"))
);
 
How can I do this?
 
Answer: You will need to create a join and then handle your projections with the prefix of the entity name.  Example:
 
IQueryable query = (IQueryable)EntityFactory.GetRepository();
IExpressionFactory expressions = query.GetExpressionFactory();
IProjections projections = query.GetProjectionsFactory();

ICriteria criteria = query.CreateCriteria("account")
.CreateCriteria("Address", "address", JoinType.InnerJoin) <<-- here I add address to my list of projections
.SetProjection(projections.ProjectionList()
.Add(projections.Property("account.Id"))
.Add(projections.Property("account.AccountName"))
.Add(projections.Property("address.Address1"))
.Add(projections.Property("address.City"))
.Add(projections.Property("address.State"))
.Add(projections.Property("address.Country"))
.Add(projections.Property("account.MainPhone"))
).Add(expressions.Eq("account.ResellerID", account.Id));

What's This?
  
Bookmark and Share

About SalesLogix Support

   Your SalesLogix Business Partner for SalesLogix Support.


Related Content
   Determining User Rights in the Infor CRM (Formerly Saleslogix) LAN Client
I recently had a client ask how to get a query to tell which users have rights to add, edit, and delete v
Posted on Apr 03, 2015 by Kris Halsrud to Kris Halsrud's Blog
 
   How do I wrap text in Textboxes in Infor CRM (formerly Saleslogix)?
Recently an Infor CRM administrator contacted me in regards to many of their textboxes for Notes in the I
Posted on Apr 01, 2015 by Dale Richter to Infor CRM Questions & Answers
 
   InforCRM (formerly Saleslogix) Mobile - Clearing Out Earlier Customizations
If you started with an earlier version of SalesLogix Mobile, let's say version 7.5.4, and customized
Posted on Mar 30, 2015 by Mark Duthoy to SalesLogix Support
 
   How do you set the Base Directory when Deploying your Web Client on Infor CRM 8.1?
Question:How do I make sure my Base Directory is set correctly on Infor CRM ? Recently I had a custo
Posted on Mar 06, 2015 by Dale Richter to Infor CRM Questions & Answers
 
   How do I fix a corrupt Picklist in Infor CRM version 8.1?
I had a user ask how to fix a corrupt picklist. The picklist did not show any values when trying to e
Posted on Feb 06, 2015 by Dale Richter to Infor CRM Questions & Answers
 
Comments

No Comments
All contents Copyright © 2015 Customer FX Corporation
Customer FX Corporation
2324 University Avenue West, Suite 115
Saint Paul, Minnesota 55114
Tel: 800.728.5783

  Follow @CustomerFX on twitter
Follow the best news, tips, and articles
  Subscribe to Customer FX on youtube
Watch SalesLogix tutorial videos from Customer FX
Login / Register