Showing or Hiding the Lead Qualify Button in bpm’online

In the Lead section of bpm’online, there’s a “Qualify” button that can be used when you qualify a lead. This button triggers a process to do things such as link to an existing contact/account or create a new one, create an opportunity, create some tasks, etc. However, what if you only want this button to show when certain conditions are met? Maybe the current user being in a role, or some conditions in the lead data itself to be met?

These are the buttons I’m referring to:

It’s a pretty easy task to customize this. We’ll be adding this to the LeadSection itself. The LeadSectionV2 has a mixin called LeadManagementUtilities where most of this is implemented. However, a mixin becomes a part of the thing it’s mixed into, meaning we can just customize this in the LeadSectionV2 rather than extend the LeadManagementUtilities module. The code we care about for this task is in the initLeadManagementButtonVisibility function. We’ll override that, call the original function, then perform our own logic to change what the initLeadManagementButtonVisibility did, if needed.

First, we’ll need a replacing schema for LeadSectionV2. The easiest way to do that is to open the section wizard for the Lead section, then click Save (no other changes are needed). Then, we’ll see our LeadSectionV2 in our configuration. Open it and add the following code:

define("LeadSectionV2", [], function() {
    return {
        entitySchemaName: "Lead",
        methods: {
            initLeadManagementButtonVisibility: function(entity) {
                this.callParent(arguments);
                
                // we can set this to true/false based on whatever our conditions are
                var showQualifyButton = false;
                
                // now show or hide the button
                this.set("LeadManagementButtonVisible", showQualifyButton);

                // you can do the same with the disqualify action menu items
                this.set("DisqalificationButtonVisible", showQualifyButton);
            }
        }
    };
});

Note, you’ll need to add the same code to the LeadPageV2 as well so it can properly show/hide the button when in edit mode.

ABOUT THE AUTHOR

Ryan Farley

Ryan Farley is the Director of Development for Customer FX and creator of slxdeveloper.com. He's been blogging regularly about SalesLogix, now Infor CRM, since 2001 and believes in sharing with the community. He loves C#, Javascript, web development, open source, and Linux. He also loves his hobby as an amateur filmmaker.

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Join our mailing list to receive the latest Infor CRM (Saleslogix) news and product updates!

You have Successfully Subscribed!