Posted 4/25/2007 10:42:35 AM | | | | Hi All, I'ver followed the exercise 4.3b - building a page dervied from AreaPage and getting the data from the GridData. If I use the same fetchxml in the grid objgrid.fetchxml then I get data. If I use this in a fetchdata page I get no griddata, however, the selected tells me 0 of 11 selected. Any points? code snippets: Public Overrides Sub BuildContentArea()MyBase.BuildContentArea()' Create an instance of the GridDim objGrid As IGrid = ControlFactory.CreateGrid()' Name the IDobjGrid.ID = "TestGrid"objGrid.ReturnedTypeCode = 1 objGrid.SortCol = "fullname"objGrid.SearchingStyle = SearchingStyles.None objGrid.ViewsSelectorStyle = ViewsSelectorStyles.None ' objGrid.ShowJumpBar = TrueobjGrid.FetchDataPage = "AccountsandContacts_DataPage.aspx"'specify which columns you'd like to show for this search objGrid.ColumnHeaders.Add(ControlFactory.CreateColumnHeader( "Name", "fullname", 200))'objGrid.ColumnHeaders.Add(ControlFactory.CreateColumnHeader("Phone Number", "telephone1", 200))'objGrid.ColumnHeaders.Add(ControlFactory.CreateColumnHeader("Notes", "description", 500))Instance.ContentArea.Controls.Add(objGrid.Control) End SubPublic Overrides Sub FetchData()MyBase.FetchData()Dim filtervalue = CleanFilterValue(Instance.JumpValue)' Retrieve all accounts starting with the letter "A" Dim fetch As Stringfetch = "<fetch mapping='logical'><entity name='account'><all-attributes/></entity></fetch>"Dim strResultSet As String = CrmService.ExecuteFetchXml(fetch)'map the account field "name" to "fullname" so that all'(both accounts and contacts) fall under the same column. strResultSet = strResultSet.Replace( "<name>", "<fullname>")strResultSet = strResultSet.Replace( "<name/>", "<fullname/>")strResultSet = strResultSet.Replace( "<name ", "<fullname")strResultSet = strResultSet.Replace( "</name>", "</fullname>")' Retrieve all contacts having the lastname that startsDim fetch2 As Stringfetch2 = "<fetch mapping='logical'><entity name='contact'><all-attributes/></entity></fetch>"Dim strResultSet2 As String = CrmService.ExecuteFetchXml(fetch2)Me.SortCol = "fullname"'GridDataPage method to add the results from the fetchXML AddResultSetToReturn(strResultSet, 1, "accountid")AddResultSetToReturn(strResultSet2, 2, "contactid")End Sub |
| Posted 4/25/2007 11:38:34 AM | | | | OK, its started working;-) Downloaded 3.0.9.9, tested the new excercises - ok ..and my code now works |
| Posted 4/25/2007 11:50:00 AM | | | | Ignore my previous post, VB.NET inserts a line calling the base method that is being overridden i.e mybase.FetchData() This appears to be the root of my troubles. I commented out this line and its OK. |
| |
|