Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, July 4, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Web Forums - SalesLogix Web Platform & Application Architect
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Platform & Application Architect | New ThreadView:  Search:  
 Author  Thread: Cancel Save and prompt a user friendly message
Henri Lo
Posts: 5
 
Cancel Save and prompt a user friendly messageYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Oct 09 7:45 PM
Hi there,

I have a custom business rule to be executed before saving a record and if the rule fails, I would like to display an user friendly message to the screen. My current approach is to add a C# Code Snippet to BeforeInsert or BeforeUpdate Event, then throw a new ApplicationException if the business rule fails. This prevents saving the record, which is good, however, the message displayed is not user friendly. For example:

'An exception occurred executing the dynamic method Ticket.OnBeforeInsert.: [My exception goes message.]'

It would be nice if I can just display my custom exception message. Any idea? or other approach?

Regards,

Henri

[Reply][Quote]
David Lumm
Posts: 87
 
Re: Cancel Save and prompt a user friendly messageYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Oct 09 3:30 AM
Instead of letting the built-in SLX Exeption handler deal with it, put a try catch around your code and in the catch use the dialogservice to display a message - it's not as pretty, but it means that you'll have more control.
[Reply][Quote]
Henri Lo
Posts: 5
 
Re: Cancel Save and prompt a user friendly messageYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Oct 09 6:41 PM
DialogService does sound like the way to go. Can you please direct to which namespace I can access DialogService? Sorry, I am really newbie here. Thanks.
[Reply][Quote]
Henri Lo
Posts: 5
 
Re: Cancel Save and prompt a user friendly messageYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Oct 09 6:55 PM
Hi David,

I did a search on the forum, it seems like DialogService can be accessed via this identifier. My situation is different, please see the following code I have:

namespace Sage.BusinessRules.CodeSnippets
{
public static partial class TicketBusinessRules
{
public static void OnBeforeUpdateStep_PreExecute( ITicket ticket, ISession session)
{
this.DialogService <--- cant access this identifier because it is a static method.
}
}
}

I cant access 'this' identifier because I am add C# Code Snippet to the Event Business Rule. Any idea? Can you please provide me some sample code?

Thank you so much.
[Reply][Quote]
David Lumm
Posts: 87
 
Re: Cancel Save and prompt a user friendly messageYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Oct 09 5:05 AM
Hi

I'm afraid I'm not sure exactly what you'd need to do, having not done it before. You could use the following syntax, except this is missing something...

Sage.Platform.WebPortal.Services.WebDialogService service = new Sage.Platform.WebPortal.Services.WebDialogService();
service.ShowMessage("Test");


Unfortunately it needs an IPageWorkItemLocator reference in the empty brackets and I'm not sure what to put in there...

Sorry I can't help any more!
[Reply][Quote]
Mike LaSpina
Posts: 116
 
Re: Cancel Save and prompt a user friendly messageYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 Oct 09 6:10 PM
You can add a message to your exception as well - it takes an optional message as a parameter. For example:

throw new Sage.Platform.Application.ValidationException("Field xxx is required.");

This pops a java alert box with your message to the user and halts execution of the save.
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 7/4/2025 10:24:45 AM