back to top

Generating table IDs in the SalesLogix web client

 

The SalesLogix entity model implemented in the web client takes a lot of burden of developers.  In the LAN based SalesLogix application, developers worked directly at the database level and were responsible for generating keys and other required fields when inserting data into a table.  The entity model handles key generation automatically so that the simple act of adding a new entity record will automatically populate the primary key and other fields like CREATEUSER and CREATEDATE. 

There may be cases where you do want to get a ID for a table in the SalesLogix Web environment like you used to be able to do in the SalesLogix LAN client with a call to Application.BasicFunctions.GetIDFor(“HISTORY”).  Lets look at how.

Sage.SalesLogix.SalesLogixEntityKeyGenerator keyGenerator =
    new Sage.SalesLogix.SalesLogixEntityKeyGenerator();

With the entity key generator instantiated you can now access it to generate as many IDs as you want. The GenerateIDs method will return a list of IDs for the entity passed into the first parameter of the method.  The second parameter specifies how many keys to generate.

List<string> keys = new List<string>(keyGenerator.GenerateIds(typeof(Sage.Entity.Interfaces.IHistory), 1))

With the list you can then loop through and use them:=.  A simple way to access the first ID in the List

string newID = null;
foreach (string key in keys)
{
    newID = key;
    break;
}

All together the code is:

Sage.SalesLogix.SalesLogixEntityKeyGenerator keyGenerator =
    new Sage.SalesLogix.SalesLogixEntityKeyGenerator();
List<string> keys = new List<string>(keyGenerator.GenerateIds(typeof(Sage.Entity.Interfaces.IHistory), 1))
string newID = null;
foreach (string key in keys)
{
    newID = key;
    break;
}

There you go. A simple way of generating Keys.

Contact Customer FX for your CRM project
We let our expertise speak for itself - let us know how our all-star team can help on your CRM project
About the Author
Kris Halsrud
Kris Halsrud
Kris Halsrud is a Senior Analyst / Developer for Customer FX Corporation.

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Infor CRM Sync for Exchange: Action Required by August 31, 2026

Using Infor CRM Sync for Exchange with Microsoft 365? Your Exchange administrator must update tenant settings by August 31, 2026 to prevent sync disruption.

[Webinar] What’s Coming Next for Infor CRM SLX and Why v10 Matters

See what’s coming next for Infor CRM SLX, including new marketing workflows, automation improvements, and reasons to consider upgrading to v10.

Disable Caching in Infor CRM SLX Web Client

In the rare case caching is causing issues in the Infor CRM SLX web client, it is possible to disable specific types of caching by making edits using Application Architect, and then deploying.

Exploring AI Options for Infor CRM v10

I've started taking a closer look at the AI capabilities built into Infor CRM v10. Over the next several posts, I'll share what I learn. From the built-in features and supported AI providers to implementation considerations, costs, and practical use cases.

Infor CRM SLX 10.0: Delegate Ownership Changes for “Everyone” Records

Learn how the new EveryoneOwnerAssignment secured action in Infor CRM SLX 10.0 allows designated users to change ownership of Everyone-owned records without requiring Administrator access.

Related Articles

Infor CRM Sync for Exchange: Action Required by August 31, 2026

Using Infor CRM Sync for Exchange with Microsoft 365? Your Exchange administrator must update tenant settings by August 31, 2026 to prevent sync disruption.

[Webinar] What’s Coming Next for Infor CRM SLX and Why v10 Matters

See what’s coming next for Infor CRM SLX, including new marketing workflows, automation improvements, and reasons to consider upgrading to v10.

Disable Caching in Infor CRM SLX Web Client

In the rare case caching is causing issues in the Infor CRM SLX web client, it is possible to disable specific types of caching by making edits using Application Architect, and then deploying.

Exploring AI Options for Infor CRM v10

I've started taking a closer look at the AI capabilities built into Infor CRM v10. Over the next several posts, I'll share what I learn. From the built-in features and supported AI providers to implementation considerations, costs, and practical use cases.

Related Videos