6/29/2025 11:32:56 PM
|
|
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!
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.
|
|
|
|
Insert activity, how to display messagebox instead of red asterisk for required fields?
Posted: 04 Jun 10 2:40 PM
|
Hi all, I'm doing some customizations in insert activity form. Currently, when you want to save the activity, if there are empty required fields, a red asterisk is displayed next to them. The problem is that since activity screen it's a tabbed interface, sometimes the user clicks ok and nothing happens seemingly for no reason...and it's because a required field is missing in a tab other than the currently active tab.
This is quite unintuitive, is there a way to display a messagebox telling the user "this or that field are required"? I imagine SLX uses standard .net validators, so it should be easy right?
Any ideas? |
|
|
|
Re: Insert activity, how to display messagebox instead of red asterisk for required fields?
Posted: 04 Jun 10 3:25 PM
|
Generally, I like to code a Validate business rule on the entity that I call in the pre-execute steps of the OnBeforeInsert and OnBeforeUpdate events for that entity. You can validate the fields and call "throw new Sage.Platform.Application.ValidationException("Your Message Here");" to prevent the save (and dialog close) from happening. This will pop up a message box with whatever text you specify.
The added advantage here is that the rule is enforced from everywhere - even SData calls. |
|
|
|
Re: Insert activity, how to display messagebox instead of red asterisk for required fields?
Posted: 05 Jun 10 11:22 AM
|
Thanks for the reply Mike! Your solution is more or less what I use to do for the same reasons you mention (ensuring that the validation BRs are enforced no matter where the entity is created from etc).
The problem in this case is that there's some client side validation running on the Activity detail form (I assume JS?), so the page isn't even posted back to the server, which would trigger the onbeforeinsert event and do what you describe...makes sense? So, what I need to do is to modify that client side validation to display a message, but i don't even know where that code is... |
|
|
|
Re: Insert activity, how to display messagebox instead of red asterisk for required fields?
Posted: 07 Jun 10 12:26 PM
|
There is at least 1 required field on the form - StartDate. If you open the ActivityDetails.ascx file under Portal Manager -> SalesLogix -> SupportFiles -> SmartParts -> Activity and search for the text 'required', you will find fields that use client side validation (the text "Required=true" appears in the control definition). You can turn these off if you want to do it server side. That should be all you need to do. Note you will have to repeat this each time you upgrade to a version that contains this object. I do not believe that fields on any of the other tabs are required. |
|
|
|
Re: Insert activity, how to display messagebox instead of red asterisk for required fields?
Posted: 09 Jun 10 12:21 PM
|
Hi Mike. Do you know if the validation routine uses standard ASP.NET validators? I ask because they are pretty easy to customize to bring up the messagebox i'm looking for. My client wants client-side validation (hence, i cannot just "get rid" of the validation by taking out the required=true), but wants a messagebox instead of just the red asterisk. Makes sense? |
|
|
| |
|
Re: Insert activity, how to display messagebox instead of red asterisk for required fields?
Posted: 09 Jun 10 1:23 PM
|
You can add validators if you want - you just have to code them. Right now, there is just the standard required field validator that's implicitly called by the Required=True. I would replace that with an ASP validator control and generate an alert on failure. I don't think you'll be able to do an alert strictly on the client side, so you may have to validate on the server side and generate the JScript. However, you can put any text in there, so a message such as a red "Start Time is Required" is a lot easier to see than an asterisk.
|
|
|
| |
| |
|
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!
|
|
|
|
|
|
|
|