Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Highlighted
New Member
Posts: 5
Registered: ‎01-03-2012

Unusual error using repository

I am using 7.5.4, SQL 2005.  Trying to get a value for picklist text.  The following code:

 

 

{

Sage.Entity.Interfaces.ITicketHistory item = Sage.Platform.EntityFactory.Create<Sage.Entity.Interfaces.ITicketHistory>();

item.Ticket = tactivity.Ticket;

 

Sage.Platform.RepositoryHelper<Sage.Entity.Interfaces.IPickListItemView> repository = Sage.Platform.EntityFactory.GetRepositoryHelper<Sage.Entity.Interfaces.IPickListItemView>();

Sage.Platform.Repository.ICriteria criteria = repository.CreateCriteria();

criteria.Add(repository.EF.Eq(

"PickListItemID", tactivity.ActivityTypeCode.ToString()));

System.Collections.Generic.IList<Sage.Entity.Interfaces.IPickListItemView> result = criteria.List<Sage.Entity.Interfaces.IPickListItemView>();

}

 

The code executes until the last line, then a popup shows "Sage.Entity.Interfaces.IPickListItemView" with nothing else and the code stops.

 

Any ideas why it acts this way?

Highlighted
Copper Contributor
Posts: 10
Registered: ‎04-21-2009

Re: Unusual error using repository

It's been a while since I did anything with web picklists, but I think you would be better off looking at the Sage.SageLogix.PickLists namespace.  There's a PickList class with a bunch of methods that should give you what you're looking for with fewer lines of code.  If I get time later, I'll dig up some old code that I've used in the past and send you an example.