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
   Can I Bind an Attachment to a Specific Activity in Infor CRM version 7.54?
Recently I had a user ask if they could bind an attachment to a specific Activity within Infor CRM??
Posted on Jul 07, 2015 by Dale Richter to Infor CRM Questions & Answers
   Infor CRM (Formerly Saleslogix) Iterating through all tabs on a Page
 Using the TabWorskpace you can iterate through all the tabs on a page and do something with them, l
Posted on Jun 19, 2015 by Kris Halsrud to Kris Halsrud's Blog
   Infor CRM (Formerly Saleslogix) Hiding Tabs at Runtime Without Using Modules
 As Ryan wrote a long time ago, you can create a module and add it to a page in the Infor CRM web cl
Posted on Jun 10, 2015 by Kris Halsrud to Kris Halsrud's Blog
   How I assign ownership to a group of Leads in Infor CRM?
There is a tool within Infor CRM to align Accounts to different Account Owners. It is called Territory Re
Posted on Jun 05, 2015 by Dale Richter to Infor CRM Questions & Answers
   Infor CRM (Formerly Saleslogix) Adding a Client Side Confirmation on a Dependency Lookup in the Web Client
 We recently had a client who wanted to have a user confirmation prompt before a user was allowed to
Posted on May 28, 2015 by Kris Halsrud to Kris Halsrud'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