Login / Register  search  syndication  about

          Kris Halsrud's Blog

Kris Halsrud on development and Integration with CRM and Development

How to change the "Closed - Lost" Probability in the 7.5 SalesLogix web client

In this post I discussed how the SalesLogix 7.5 web client modifies close probability different than the LAN client.  I now want to talk about how you can change this behavior to match the LAN client.

The first thing we need to understand is how the SalesLogix web client is setting the close probability.  Since we know that the close probability is set when the status changes, there are only two places that this can happen:

1 In code on the form

2 In rules in place within the entity model

I know by digging that there is no code that is setting this value on any of the standard opportunity screens.  That leaves us with something in the entity model itself.  If we look at the rules under the Opportunity entity, we will find there isn't a rule that does what we are looking for:

SalesLogix Opportunity Entity

Again, I know this because I examined what each of the rules is doing.  So where else can this logic be built into?  Well it turns out that every property in an entity can have, at present, two custom events tied to it, an "OnBeforeChange", and an "OnAfterChange".  If we look at the Opportunity entity we can see the status property has a custom event by default called "OnBeforeStatusChanged".

SalesLogix Opportunity Entity Custom Property Events

Ah, ha! So now we are getting somewhere.  So if we double click on the event, the event page will open in the Application Architect.

SalesLogix Opportunity Status BeforeChange Events

Now, you will notice there is an event described called "onBeforeStatusChanged" as the primary step of the event.  For those that have worked with many events, you will notice there is no ability to edit the event code.  If you notice, the type name is in the Sage.SalesLogix.BusinessRules class, which is a core un-customizable area.  That stinks.  But lets take a look any ways.  Using reflector we can examine what this event in the BusinessRules class is doing.

Status BeforeChange Code

OK, so it is calling another event "setOppValues".  Again using Reflector we can see this is a protected member of the BusinessRules class:


OK.  So now we know how it is getting called.  However because it is in the core BusinessRules class, we can't modify this action.  This is one of those things that bugs me about how some of the code in the SalesLogix web client is designed.  They say it is open, but a lot of it is not really open the way you might think.  What we need to do is to add a later step to basically "undo" what the core code is doing wrong (or differently than what we might like).

So what we can do is to add a new event on the Status property of the Opportunity entity.  We do this by right clicking on "Status" and choosing "New AfterChange Event"

Adding a new SalesLogix Event to a Property

Once we do that, we can then write new code during this event.  This event will run after the before change event, and essentially undo what we want.

Adding a new SalesLogix Event to a Property 2

Since this is custom code, we have the ability to Add new code under the Primary Steps tab.  Click on the Add hyperlink and then choose C# code snippet.

Adding a new SalesLogix Event to a Property 3

When you click OK, you can then choose to edit the code by clicking the "Edit Code Snippet" hyperlink.

Now we can add our preferred rule, such as:

            if (args.NewValue.ToString() == "Closed - Lost")
                opportunity.CloseProbability = 0;

With this added we now will negate what SalesLogix is doing OOTB and we can match the behavior of the LAN based SalesLogix client.

Important Note

Please note that custom events on Entity Properties did not work quite right in SalesLogix 7.5.  SalesLogix 7.5.1 addressed the issues to this area.  You will be unable to add new events to Properties in 7.5.  You also will not be able to install a manifest that has custom events contained in it in a 7.5 system. 

What's This?
Bookmark and Share

About Kris Halsrud

   Kris Halsrud is a Senior Analyst / Developer for Customer FX Corporation.

Related Content
   How do you set the Base Directory when Deploying your Web Client on Infor CRM 8.1?
Question:How do I make sure my Base Directory is set correctly on Infor CRM ? Recently I had a custo
Posted on Mar 06, 2015 by Dale Richter to Infor CRM Questions & Answers
   How do I fix a corrupt Picklist in Infor CRM version 8.1?
I had a user ask how to fix a corrupt picklist. The picklist did not show any values when trying to e
Posted on Feb 06, 2015 by Dale Richter to Infor CRM Questions & Answers
   Creating a Searchable & Filterable ComboBox in Infor CRM (Saleslogix) Web Client
I've had a few posts lately covering the ComboBox control in the Infor CRM (Saleslogix) Web Client. T
Posted on Feb 05, 2015 by Ryan Farley to Ryan Farley's Blog
   Limiting the Height of the Infor CRM (Saleslogix) ComboBox Popup
In my last post, I discussed how the Infor CRM (Saleslogix) ComboBox is a Dijit Select form widget. This
Posted on Jan 29, 2015 by Ryan Farley to Ryan Farley's Blog
   How to Disable the ComboBox Control in the Infor CRM (Saleslogix) Web Client
There's a problem with the ComboBox control in the Infor CRM (Saleslogix) Web Client. It won't di
Posted on Jan 22, 2015 by Ryan Farley to Ryan Farley's Blog

No Comments

Leave a Comment

All contents Copyright © 2015 Customer FX Corporation
Customer FX Corporation
2324 University Avenue West, Suite 115
Saint Paul, Minnesota 55114
Tel: 800.728.5783

  Follow @CustomerFX on twitter
Follow the best news, tips, and articles
  Subscribe to Customer FX on youtube
Watch SalesLogix tutorial videos from Customer FX
Login / Register