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
   Problem with the Clean Build Folders option in Application Architect
On occasion, it becomes necessary to clean out the build folders and deployed website prior to a build/de
Posted on Sep 16, 2014 by Jason Buss to Jason Buss' Blog
 
   ComboFix Kills Saleslogix Sync
ComboFix, a third party malware utility, will alter the Operating system so .qts and .que files will no l
Posted on Sep 12, 2014 by Brianna Ojard to SalesLogix Support
 
   Restricting Adding Opportunity Contacts to Contacts at the Opportunity's Account
 One thing that clients have asked for is how to restrict the selection of the Opportunity Contacts
Posted on Sep 09, 2014 by Kris Halsrud to Kris Halsrud's Blog
 
   How do I access the new Opportunity that I created in Saleslogix??
I had a user ask why they could not access a Salelogix opportunity when they clicked the hyperlink from t
Posted on Sep 04, 2014 by Dale Richter to SalesLogix Questions & Answers
 
   Configuring and Packaging secured actions in Saleslogix 8.0
Using Secured Actions, you can restrict access to user interface elements in the Saleslogix web client.
Posted on Aug 12, 2014 by Jason Buss to Jason Buss' 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