Setting Lead DNC Fields to Match Do Not Solict Default When Creating New Leads in Infor CRM Web

Within lead records in Infor CRM, there are a number of Do not contact fields, such as DoNotSolicit, DoNotMail, DoNotPhone, etc…  Infor CRM provides an area to set up a default value for the DoNotSolicit value on new Leads, however it does not do anything with the other Do not contact fields.

In InforCRM, the DoNotSolict value supersedes the other Do Not Contact fields, so it shouldn’t matter, however some of our clients find it confusing to have the additional Do Not contact fields not match the Do Not Solicit value when creating a new opportunity.

First of all, how do you set the default for DoNotSolicit?

This is done in the web client under the Custom Settings section on the Administration Navbar.  From there, find the settings with the “Default Settings” category.  Click the Description Link to open the detail view for that setting:

Custom Settings

On the detail for the setting, set the Value to “T” or “F” depending on your needs.

Custom Settings detail

After saving that change, creating new lead (and contact) record will default the DoNotSolicit value to what was specified.

The remaining Do Not Contact fields have no default, so they will be unchecked (false) when the record is created.  How do we get those fields to mirror the defaulted DoNotSolicit value?  We can do this by simply creating a new Event item in the Lead entity.

Post Insert event

We’ll create a new OnAfterInsert event for the Lead entity.  In this database, there is already a primary step, so I created Post Execute Step to contain my code.

And this is the code I added:

namespace Sage.BusinessRules.CodeSnippets
    public static partial class LeadBusinessRules
        public static void SetDNCFields( ILead lead)
            // TODO: Complete business rule implementation
            lead.DoNotEmail = lead.DoNotSolicit;
            lead.DoNotFAX = lead.DoNotSolicit;
            lead.DoNotMail = lead.DoNotSolicit;
            lead.DoNotPhone = lead.DoNotSolicit;

In my code, I’m simply using the DoNotSolicit property to set the other DNC properties.  Since this is an after insert event, we need to Save the change to the Entity values as well.

Something similar could be applied in the Contact entity as well, since contact contains the same DNC fields as the Lead entity.

And that should do it.  Build and Deploy after this change, and your DNC fields should all match up when creating a new record.

Thanks for reading!



Jason Buss

Jason is a senior application developer with Customer FX.

Submit a Comment

Your email address will not be published.

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!