back to top

Fixing the Orphaning of Salesfusion Data when Converting Leads to Contacts in Infor CRM (Saleslogix)

We have had a couple of clients recently come to us with the same problem-

When you convert a Lead to a Contact in Saleslogix, all of the related Salesfusion data in the Salesfusion tables (those starting with SF_) gets orphaned and therefore the resulting Contact record looks as if it has had no prior marketing interactions.

This post describes the steps on how I went around to fix this issue.

Create a new Contact field

  1. In the Saleslogix Administrator, open the DB Manager.
  2. Add a new field to the CONTACT table called LeadId.  Make the field type an SLX Standard ID.
  3. You may also want to index this field.
  4. Apply your changes.

 

Add the newly created field to the  Entity Model

  1. In the Saleslogix Application Architect, expand out the Entity Model for  the SalesLogix Application Entities.
  2. Right click on the Contact entity and choose Update properties.
  3. Towards the bottom of the list, check the include check box on the new LeadId field.

 

Add code to populate the LeadId field

  1. In the Saleslogix Application Architect, expand out the Entity Model for  the SalesLogix Application Entities.
  2. Expand out the Lead entity, Business Rules.
  3. Double click the ConvertLeadToContact rule.
  4. Click on the Post Execute Steps tab.
  5. Click Add  to add a new C# Code Snippet.
  6. Edit the new code snippet.  Replace the Commented out line with: contact.LeadId = lead.Id.ToString();
  7. Save the changes to the rule.

 

Add Code to the After Contact Save

  1. In the Saleslogix Application Architect, expand out the Entity Model for  the SalesLogix Application Entities.
  2. Expand out the Contact entity, Events.
  3. Double click on the OnAfterInsert step.
  4. Click on the Post Execute Steps tab.
  5. Click Add  to add a new C# Code Snippet.
  6. Edit the new code snippet. Put the following code in and save.

Sage.Platform.RepositoryHelper<Sage.Entity.Interfaces.ISF_WEBACTIVITY> repository =
                Sage.Platform.EntityFactory.GetRepositoryHelper<Sage.Entity.Interfaces.ISF_WEBACTIVITY>();
            Sage.Platform.Repository.ICriteria criteria = repository.CreateCriteria();
            criteria.Add(repository.EF.Eq(“LEADID”, contact.LeadId));       
            System.Collections.Generic.IList<Sage.Entity.Interfaces.ISF_WEBACTIVITY> acts = criteria.List<Sage.Entity.Interfaces.ISF_WEBACTIVITY>();
            foreach(Sage.Entity.Interfaces.ISF_WEBACTIVITY act in acts)
            {
                act.CONTACTID=contact.Id.ToString();
                act.Save();
            }
           
           
            Sage.Platform.RepositoryHelper<Sage.Entity.Interfaces.ICampaignTarget> repository2 =
                Sage.Platform.EntityFactory.GetRepositoryHelper<Sage.Entity.Interfaces.ICampaignTarget>();
            Sage.Platform.Repository.ICriteria criteria2 = repository2.CreateCriteria();
            criteria2.Add(repository2.EF.Eq(“EntityId”, contact.LeadId));       
            System.Collections.Generic.IList<Sage.Entity.Interfaces.ICampaignTarget> clks = criteria2.List<Sage.Entity.Interfaces.ICampaignTarget>();
            foreach(Sage.Entity.Interfaces.ICampaignTarget clk in clks)
            {
                clk.TargetType = “Contact”;
                clk.EntityId=contact.Id.ToString();               
                clk.Save();
            }
           
            Sage.Platform.RepositoryHelper<Sage.Entity.Interfaces.ISf_Dialog> repository3 =
                Sage.Platform.EntityFactory.GetRepositoryHelper<Sage.Entity.Interfaces.ISf_Dialog>();
            Sage.Platform.Repository.ICriteria criteria3 = repository3.CreateCriteria();
            criteria3.Add(repository3.EF.Eq(“Lead”, contact.LeadId));       
            System.Collections.Generic.IList<Sage.Entity.Interfaces.ISf_Dialog> dis = criteria3.List<Sage.Entity.Interfaces.ISf_Dialog>();
            foreach(Sage.Entity.Interfaces.ISf_Dialog di in dis)                        
            {
                di.Contact1 = contact;
                contact.Sf_Dialogs.Add(di);
                di.Save();
            }
           
           
            Sage.Platform.RepositoryHelper<Sage.Entity.Interfaces.ISf_Event> repository4 =
                Sage.Platform.EntityFactory.GetRepositoryHelper<Sage.Entity.Interfaces.ISf_Event>();
            Sage.Platform.Repository.ICriteria criteria4 = repository4.CreateCriteria();
            criteria4.Add(repository4.EF.Eq(“Lead”, contact.LeadId));       
            System.Collections.Generic.IList<Sage.Entity.Interfaces.ISf_Event> evs = criteria4.List<Sage.Entity.Interfaces.ISf_Event>();
            foreach(Sage.Entity.Interfaces.ISf_Event ev in evs)
            {
                ev.Contact1 = contact;
                contact.Sf_Events.Add(ev);
                ev.Save();
            }

Note that this code assumes the entity property added to the Contact entity is called “LeadId”.  This is case sensitive so be aware of that.

Finally build and re-deploy.

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.

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