Manually setting an ID for a SalesLogix web entity
Posted By: Alex.Cottner on February 25th, 2013 in General
No Gravatar

We ran into a situation last week where we needed to manually generate ID’s for a SalesLogix entity. This seemed like a straight forward task, however the Id property is read only. After a little reverse engineering this is what we’ve come up with.


var entity = Sage.Platform.EntityFactory.Create();
((Sage.Platform.ComponentModel.IAssignableId)entity).Id = "MyCustomId";
entity.Save();


Invoke a Crystal Report in SalesLogix 8 (and 8.1!)
Posted By: nicocrm on February 5th, 2013 in General
No Gravatar

In previous version we could use the ShowReport function to invoke a Crystal Report. This was originally designed as a quick fix to address the need and in SalesLogix 8 Sage has cleaned up the interface and moved it to a well defined client-side service (this is a common trend in SalesLogix 8 and you’ll see many other interfaces that were previously just available as global, organized into services).

The service is not available by default but can be loaded via a require call. The simplest way to invoke a report, when you know the entity id you want to run against, is like this:

require(['Sage/Reporting/Service'], function() {
  Sage.Services.getService('ReportingService').showReport(reportName, reportTable, entityId);
});

This runs from client script, but can be registered to run via ScriptManager.RegisterStartupScript, as usual. “reportName” is just the name in family:name format, for example Account:Account Detail. “entityId” is the table id to display (this can also be a comma-separated list of ids). More options are available through the use of a custom “report job”. Be careful to use the global service, and not instantiate your own copy of the ReportingService – the reporting window will rely on it to get the details about the report to run. Also this will open the report in a popup window so make sure they are not blocked.

For more information including a detailed before/after comparison of the API, head over to the Sage Community site where Mike Cessna has posted some detailed documentation.

UPDATE: On SalesLogix 8.1, the code is similar but the file has been moved to a different location:

require(['Sage/Services/ReportingService'], function() {
  Sage.Services.getService('ReportingService').showReport(reportName, reportTable, entityId);
});