Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Saturday, June 28, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Web Forums - SalesLogix Web Platform & Application Architect
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Platform & Application Architect | New ThreadView:  Search:  
 Author  Thread: No Results from RepositoryHelper
Bill
Posts: 10
 
No Results from RepositoryHelperYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 Apr 12 9:34 AM
fiogf49gjkf0d

I am trying to find the largest job number currently in the database in the entity Project.


 


Sage.Platform.RepositoryHelper<Sage.Entity.Interfaces.IProject> rep =
                Sage.Platform.EntityFactory.GetRepositoryHelper<Sage.Entity.Interfaces.IProject>();
Sage.Platform.Repository.ICriteria criteria = rep.CreateCriteria();
           
criteria.Add(rep.EF.Eq("ProjectType", "Insurance"));
criteria.AddOrder(rep.EF.Asc("JobNumber"));
criteria.SetProjection(rep.PF.Property("JobNumber"));
criteria.SetMaxResults(1);
           
Sage.Entity.Interfaces.IProject project = criteria.UniqueResult<Sage.Entity.Interfaces.IProject>();


Even when I take out the ProjectType criteria, I get nothing returned.  Does anyone have any thoughts on why this wouldn't be working?

[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: No Results from RepositoryHelperYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 Apr 12 10:33 AM
fiogf49gjkf0d

Not sure you need the SetProjection - try removing that. Also you dont need a unique result as you are setting max to 1, so that can be changed too.


Could you post the equivalent SQL for this query, and also confirm it returns the correct result?


Thanks,


Nick

[Reply][Quote]
Bill
Posts: 10
 
Re: No Results from RepositoryHelperYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 Apr 12 12:37 PM
fiogf49gjkf0d

Figured it out.  As I was building the SQL, I realized that there are 3 different 'Project Types': Division, Project Type, and Insurance Project Type.  I was looking in the wrong one.  It should have been Division.  Thanks anyways Nick.

[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 6/28/2025 10:13:33 AM