private void GetParts(string searchSku) { Parts.Clear(); List partsList = clientContext.Web.Lists.GetByTitle("Parts"); List inventoryLocationsList = clientContext.Web.Lists.GetByTitle("Inventory Locations"); CamlQuery camlQueryPartsList = new CamlQuery(); camlQueryPartsList.ViewXml = @"<View> <Query> <Where> <BeginsWith> <FieldRef Name='SKU' /> <Value Type='Text'>" + searchSku + @"</Value> </BeginsWith> </Where> </Query> </View>"; CamlQuery camlQueryInvLocationList = new CamlQuery(); camlQueryInvLocationList.ViewXml = @"<View> <Query> <Where> <BeginsWith> <FieldRef Name='PartLookupSKU' /> <Value Type='Lookup'>" + searchSku + @"</Value> </BeginsWith> </Where> <OrderBy Override='TRUE'> <FieldRef Name='PartLookupSKU' /> </OrderBy> </Query> <ViewFields> <FieldRef Name='PartLookup' LookupId='TRUE' /> <FieldRef Name='PartLookupSKU' /> <FieldRef Name='PartLookupTitle' /> <FieldRef Name='PartLookupDescription' /> <FieldRef Name='BinNumber' /> <FieldRef Name='Quantity' /> </ViewFields> <ProjectedFields> <Field Name='PartLookupSKU' Type='Lookup' List='PartLookup' ShowField='SKU' /> <Field Name='PartLookupTitle' Type='Lookup' List='PartLookup' ShowField='Title' /> <Field Name='PartLookupDescription' Type='Lookup' List='PartLookup' ShowField='PartsDescription' /> </ProjectedFields> <Joins> <Join Type='LEFT' ListAlias='PartLookup'> <!--List Name: Parts--> <Eq> <FieldRef Name='PartLookup' RefType='ID' /> <FieldRef List='PartLookup' Name='ID' /> </Eq> </Join> </Joins> </View>"; partListItems = partsList.GetItems(camlQueryPartsList); inventoryLocationListItems = inventoryLocationsList.GetItems(camlQueryInvLocationList); clientContext.Load(partListItems); clientContext.Load(inventoryLocationListItems); clientContext.ExecuteQueryAsync(onQuerySucceeded, onQueryFailed); }
http://spgameoflifewebpart.codeplex.com/ Goal: The Game of Life web part was created for a talk I presented at SharePoint Saturday New York in 2009. At the time, SharePoint 2010 was still in Beta and most people hadn't see the Enterprise Metadata Management (taxonomy) features. I used the Game of Life web part as an introduction to the new taxonomy API. I offered to provide the code, so here it is. Requirements ----------------------- - SharePoint Server 2010 with Enterprise Features - Visual Studio 2010 (inc. SharePoint tools) Setup ----------------------- 1. Add your account as a Term Store Administrator. This right is independent to Site Collection Administrator or Farm Administrator status. To open the Term Store Management Tool go to Site Actions > Site Settings > Site Administartion > Term Store Management. You can also open the same interface from Central Administration > Manage Service Applications > Managed Metadata Service. 2. Run the sol...
Comments
Post a Comment