Retrieving the current grid row ID in the SalesLogix web control

The SalesLogix grid control exposes an OnRowSelected event  during design time to allow adding code when a row is selected.  This functionality allows you to build out additional functionality around selecting a row, other than just bringing up an edit dialog.  In doing this you could for instance have a memo next to a grid that displays details of  the contents of the selected row. The SalesLogix LAN client has this functionality in several areas, like the Notes and History tab where selecting a history record, shows the notes for that history record to the side in a read only memo.

In order to get the current row reference you can use code like this (This is from a C# Snippet Action Item):

string historyid = grdSystemNotes.SelectedDataKey.Value.ToString();

The line of code above retrieves the rows data key.  With that we can then do something like:

Sage.Entity.Interfaces.IHistory notes =
    Sage.Platform.EntityFactory.GetRepository<Sage.Entity.Interfaces.IHistory>().Get(historyid) as Sage.Entity.Interfaces.IHistory;
txtNotes.Text = notes.Notes + “”;

This takes the ID retrieved from the previous line of code and then using the Sage EnityFactory, gets a reference to the specific history item the ID refers to.  From there it takes the Notes property of the returned entity and sets a memo field with the data.

See this post about important additional information.


Kris Halsrud

Kris Halsrud is a Senior Analyst / Developer for Customer FX Corporation.

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Join our mailing list to receive the latest Infor CRM (Saleslogix) and Creatio (bpm'online) news and product updates!

You have Successfully Subscribed!