6/28/2025 3:29:30 AM
|
|
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!
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.
|
|
|
|
Only one column in result set- Irepository and ICriteria
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 |
|
|
|
Re: Only one column in result set- Irepository and ICriteria
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>();
|
|
|
| |
|
Re: Only one column in result set- Irepository and ICriteria
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. |
|
|
| |
|
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!
|
|
|
|
|
|
|
|