Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Saturday, June 28, 2025 
 
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!
 Web Forums - SalesLogix Web Platform & Application Architect
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.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Platform & Application Architect | New ThreadView:  Search:  
 Author  Thread: Datakeys not working in 7.5.4
LCF
Posts: 46
 
Datakeys not working in 7.5.4Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 May 12 9:53 AM
fiogf49gjkf0d

Hi,


I upgraded my SLX web to 7.5.4 and the code that I have for deletion in a grid is not working. The code is using Datakeys to get the record selected on the grid but after the upgrade I'm getting always the value 00000000-0000-0000-0000-000000000000.


Here is my code:


 


Int32 iSelRowIndx = grdTicketTests.SelectedIndex;


if (iSelRowIndx < 0) {


this.DialogService.ShowMessage("Please select a Test Number before continuing");


} else {


string tTestID = grdTicketTests.DataKeys[iSelRowIndx].Value.ToString();


Sage.Entity.Interfaces.IticketTest ticketTest = Sage.Platform.EntityFactory.GetById<Sage.Entity.Interfaces.IticketTest>(tTestID);


if (ticketTest != null)


{


string tID = ticketTest.Ticketid;


Sage.Entity.Interfaces.ITicket ticket = Sage.Platform.EntityFactory.GetById<Sage.Entity.Interfaces.ITicket>(tID);


ticketTest.Delete();


}


}


The datakeys property of the datagrid is set to Id.


What I have to change in 7.5.4 to have this code working?


Thanks.


 

[Reply][Quote]
LCF
Posts: 46
 
Re: Datakeys not working in 7.5.4Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 29 May 12 8:32 AM
fiogf49gjkf0d

The way to get the id of the record selected in the datagrid is:


 


string tTestID = grdTicketTests.DataKeys[iSelRowIndx].Values[1].ToString();

[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Datakeys not working in 7.5.4Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Jul 12 2:59 PM
fiogf49gjkf0d

" string tTestID = grdTicketTests.DataKeys[iSelRowIndx].Values[1].ToString();   "




Values[1] is pointing at the 2nd column in the data source (0 is the first column).....which in my grid is not an ID field. So I'm getting an error using your code....


 


How do you point at the datakey Id field? I placed a Select Column in the Grid......I'm using SmartSelection on the grid.....do I need to put the Id field into a Link Column or something like that? It didn't like placing the Id field into the grid....

[Reply][Quote]
LCF
Posts: 46
 
Re: Datakeys not working in 7.5.4Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Jul 12 3:42 AM
fiogf49gjkf0d

My form is used in a tab for a ticket related entity. It has only a datagrid and a datasource. The datasource get the data by property (which is the relationship between tickets and the custom entity). the datagrid has 3 bound fields (create date, name and description) and "select" column. The DataKeyNames property of the datagrid is Id.


When the user selects a row, can delete it from the toolbar. The code behind that toolbar button is the one I posted before.


Maybe you can debug your SLX web site with Visual Studio and see where it's stored the id in your case.


 


 


 

[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Datakeys not working in 7.5.4Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Jul 12 6:36 AM
fiogf49gjkf0d

Turns out that slx is placing two ID's in many data grids.....EntityId and Id......I went after Id explicitly instead of by position and all is fine. Thanks for the help!!!

[Reply][Quote]
 Page 1 of 1 
  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!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 6/28/2025 12:29:38 AM