Click here to Skip to main content
15,902,910 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Situtation:
In SP, I've a customer list with a external data field. In the solution I have a BDC Model with an entity which contains a "ReadItem" and a "ReadList" method. When I deploy my feature and set the object permissions, I can read the Item without troubles. Now i have to search an item. I follow this instructions to create a Filter: http://msdn.microsoft.com/en-us/library/ee471425.aspx but it doesn't work, because I have always the same value in my parameter ("**") ..

Question:
How can I assign the search input to the parameter? Or what's wrong?

Code:
C#
public IEnumerable<Oppertunity> ReadList(String inputParameter)
        {
            using (CRMDataClassesDataContext db = new CRMDataClassesDataContext("server=xxx;database=xxx; uid=xxx ;pwd=xxx"))
            {
                List<Oppertunity> oppertunities = new List<Oppertunity>();
                    
                    var q = from c in db.Opportunities
                            where c.Name.Contains(inputParameter)
                            orderby c.Name ascending
                            select new Oppertunity
                            {
                                OppertunityId = c.OpportunityId,
                                Name = c.Name,
                            };

                    foreach (var o in q)
                    {
                        Oppertunity oppertunity = new Oppertunity();

                        oppertunity.OppertunityId = o.OppertunityId;
                        oppertunity.Name = o.Name;

                        oppertunities.Add(oppertunity);
                    }
                }

                return oppertunities;
            }


Thanks for help a man in education!
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900