Showing results for 
Search instead for 
Do you mean 

Using Alerts With SalesLogix

by ajappel on ‎05-03-2010 06:19 AM

Three of the more common approaches for creating alerts are:

1) Using the Button's "On Client Click" property

2) Using the Button's "Show Message" On Click Action

3) Using a Business Rule 

* The attached files will show screen shots of message that appears when each alert is invoked.

 

Alert Option 1 -  Using the Button's "On Client Click" property

This will product a small, gray message box

On the property window of a button type in your alert=   Alert('Hello World ');     

SalesLogix  will interpret this code and enter it onto the form as

script type="text/javascript">
function btnAcctAlert_ClientClick() {
alert('Hello World ');
}</script>

 

 

 

Alert Option 2 - Using the Button's "Show Message" On Click Action

 This will product a message box with a white background that can cleanly display more text than Alert option 1.

Go to the button’s On Click Action property (the same place you would go to add in a Business Rule)

Select the “Show Message” action
Enter in your Text ("Be sure to save your data before proceeding") and Title ("Directions for recording data").


 

Alert Option 3 -  Using a Business Rule

This will create a blue message box that looks like a smaller version of a SalesLogix form

Part One - Create Business Rule

  • Open the Account entity – Go to Rules, Business Rule Methods – Right click and add in a new business rule (by default this will be a Primary Step Name : AlertExample
  • On the Primary Steps tab select “Add”  and then C# Code Snippet and then OK
  • Add will open up a dialog window that will close after you select Ok
  • Select Edit Code Snippet and enter in the following code

 

public static void AlertExampleStep(IAccount account)
{
// TODO: Complete business rule implementation

string fullname = string.Empty;
foreach (Sage.Entity.Interfaces.IContact c in account.Contacts) {
if (c.IsPrimary.Value) fullname = c.FullName;
}

if (account.AccountName != null) {
if (!string.IsNullOrEmpty(fullname)) {
throw new Sage.Platform.Application.ValidationException("Alert - Primary Contact is " + fullname);
}
}

}

 

Part Two – Invoke Business Rule
  • Set  Button’s Onclick Action = Business Rule
  • Onclick Action’s Action Name = Business Rule
  • Business Rule = AlertExample
  • EntityType = Entity you are working on (e.g. Account)

 

Register Read Guidelines Request Partner or Employee Access

What's New in 8.1

Labels