The SalesLogix client side API provides the ability to retrieve the current entity record’s ID client side. This is especially useful if you want to navigate to a location based on a client side button click event and that location needs to dynamically contain the current record’s ID.
Of course, this could also be accomplished by reading some server side control, but with this method you do not need to go to that trouble.
Here is the client side code to get the current entity ID. This code displays a client side prompt of the ID and then opens a new browser window, passing in the parameter of the current ID.
var contextSvc = Sage.Services.getService(‘ClientEntityContext’);
var context = contextSvc.getContext();
var strEntityId = context.EntityId;
window.open(‘somepage.ascx?entityid=’ + strEntityId, ‘NewTarget;’);