Login / Register  search  syndication  about

          SalesLogix 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
   Error Attempting to Save an Entity: "E_FAIL(0x80004005)" in the Infor CRM (Saleslogix) Web Client
We recently had a client that was running into an issue when attempting to create one particular entity i
Posted on Sep 30, 2014 by Kris Halsrud to Kris Halsrud's Blog
 
   Video: Demystifying Infor CRM (Saleslogix) Updates
Watch it now! If you missed yesterdays demo, "Demystifying Infor CRM (Saleslogix) Updates" ,
Posted on Sep 26, 2014 by Brianna Ojard to The Inbox
 
   Thoughts on the Future and Involvement in the Saleslogix/Infor CRM Community
Over the last year and a half I've been working on another product named Contatta. It's a great p
Posted on Sep 25, 2014 by Ryan Farley to Ryan Farley's Blog
 
   Fixing the Orphaning of Salesfusion Data when Converting Leads to Contacts in Infor CRM (Saleslogix)
We have had a couple of client recently come to other with the same problem-When you convert a Lead to a
Posted on Sep 19, 2014 by Kris Halsrud to Kris Halsrud's Blog
 
   Official Infor CRM Acquisition FAQ
What to expect now that Saleslogix is Infor CRM. Like many of you, it will take some time (probably a
Posted on Sep 18, 2014 by Brianna Ojard to The Inbox
 
Comments

No Comments
All contents Copyright © 2014 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