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:

setOppValues

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
   Saleslogix (now Infor CRM) Web Client- Build Error Based on Quick Form Name
 I recently discovered a problem that will occur if you happen to name a quick form the same name as
Posted on Oct 31, 2014 by Kris Halsrud to Kris Halsrud's Blog
 
   Unicode Character Sets for SalesLogix Web 8.1
If you have the need to use unicode character sets so international users can view the web client in thei
Posted on Oct 29, 2014 by Mark Duthoy to SalesLogix Support
 
   Change the Appearance of a Saleslogix (Now Infor CRM) Read Only TextBox Web Control
In the Salelogix web client, a read only control has a css style applied to it to make the background app
Posted on Oct 24, 2014 by Kris Halsrud to Kris Halsrud's Blog
 
   Saleslogix (now Infor CRM) Web Client- Changing Label Appearances on Quick Forms
 I wrote previously about setting a label's appearance on a quick form using server side code.&n
Posted on Oct 02, 2014 by Kris Halsrud to Kris Halsrud's Blog
 
   Error Attempting to Save an Entity: "E_FAIL(0x80004005)" in the Infor CRM (Saleslogix) Web Client
We recently had a client that was running into an issue when attempting to create one particular entity i
Posted on Sep 30, 2014 by Kris Halsrud to Kris Halsrud's Blog
 
Comments

No Comments

Leave a Comment

(required)  
(optional)
(required)  
Add
All contents Copyright © 2014 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