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: Only one column in result set- Irepository and ICriteria
Mayank Pant
Posts: 8
 
Only one column in result set- Irepository and ICriteriaYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Feb 12 12:52 PM
fiogf49gjkf0d

Hi All,


In my contact page there is no binding between ICategory Table and I need only CategoryId column from ICategory table based on the category column whose value will be sent by the user(User will pass category value from text box). Is there any method by which we can get particular column value[CategoryID in this case ] from the table ICategory table using Icriteria and Irepository methods.


 


Thanks in advance


With Regards,


Mayank Pant

[Reply][Quote]
Mike LaSpina
Posts: 116
 
Re: Only one column in result set- Irepository and ICriteriaYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Feb 12 1:06 PM
fiogf49gjkf0d

If you're only getting one row back, you can use a UniqeResult:


    Sage.Platform.RepositoryHelper<Sage.Entity.Interfaces.ICategory> f = Sage.Platform.EntityFactory.GetRepositoryHelper<Sage.Entity.Interfaces.ICategory>();
    Sage.Platform.Repository.ICriteria crit = f.CreateCriteria();
    crit.Add(f.EF.Eq("CategoryName", "SomeValue"));
    crit.SetProjection(f.PF.Property("Id"));
    String sId = crit.UniqueResult<System.String>();


 

[Reply][Quote]
Mayank Pant
Posts: 8
 
Re: Only one column in result set- Irepository and ICriteriaYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Feb 12 1:21 PM
fiogf49gjkf0d

Thanks, but I only need a particular column value from the record, "CategoryID "  based on category value which is passed by the user. Is it possible?

[Reply][Quote]
Mike LaSpina
Posts: 116
 
Re: Only one column in result set- Irepository and ICriteriaYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Feb 12 2:34 PM
fiogf49gjkf0d

That's what that code should return.  I'm assuming you have named your table "Category".  Note that it's best practive to not include the ID column in the properties as it is always referenced as "Id" regardless of what entity it is.

[Reply][Quote]
Mayank Pant
Posts: 8
 
Re: Only one column in result set- Irepository and ICriteriaYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 Feb 12 12:14 PM
fiogf49gjkf0d

Thanks for help. It is working.


 


With Regards,


Mayank Pant.

[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 7:49:22 AM