Ticket S90945
Visible to All Users

Validation - Warn end-users about mistakes/inconsistencies without preventing them from saving changes

created 17 years ago

Hi,
There are times when one wants to inform the user of some sort of problem with the business logic, but an error (preventing a save of the object) may be too strict. It would be beneficial to show the user a warning so that the user can have his/her attention drawn to it, but not be prevented from saving the object.
Proposed Solution:
Dionisis Soldatos wrote in S135644:
"RuleRequiredField("Customer.Phone", DefaultContexts.Save, "The Customer Phone is Empty",TypeOfMessage.Warning)
or
RuleRequiredField("Customer.code", DefaultContexts.Save, "The Customer Code is Empty",TypeOfMessage.Error)
add new property to rulectriteria TypeOfMessage"

Comments (1)
DevExpress Support Team 16 years ago

    There is a similar discussion:
    - "XAF Validation Module" at http://community.devexpress.com//forums/p/68748/233906.aspx#233906
    Thanks, Dan

    Answers approved by DevExpress Support

    created 11 years ago (modified 11 years ago)

    We have implemented the functionality described in this ticket. It will be included in our next update(s).

    Please check back and leave a comment to this response to let us know whether or not this solution addresses your concerns.

    Additional information:

    You can now define validation rules that can be ignored by end-users by setting the rule's ResultType property to Warning or Info.
    See Also: XAF: Soft Validation (What’s New in 13.2)

      Show previous comments (4)

        There is a lesser known framework called SAP. May be a few of you have heard about it? They have had warnings for over 15 years may be more. But that's what smaller unknown framework do… they implement all these useless features which are not priority for the majority in the hope of attracting clients.
        Joking apart, this is thanksgiving here in the US so a big thank you Devexpress for implementing this. I promise not to ask about reminder in the Scheduler Module before another few months. ;)
        Happy thanksgiving all.

        Dennis Garavsky (DevExpress) 11 years ago

          You are always welcome, Guys:-)

            Great!!! Thanks Dennis

            created 16 years ago (modified 12 years ago)

            Currently, to work around this, you can use the approach shown in the OBSOLETE - How to provide custom rules validation via the RuleSet's events example. For instance, you can skip the default validation and then show a message to a user using the DevExpress.ExpressApp.Web.ErrorHandling.SetPageError method in Web Forms. In Windows Forms you can show a warning message to a user using the standard MessageBox class, or something else.
            Alternatively, you can manually validate your objects when editors lost focus, as described in the Implement Custom Contexts help topic.
            See Also:
            Validation - Add validation support for business classes implementing the IDXDataErrorInfo interface
            http://community.devexpress.com/forums/227981/PostAttachment.aspx - here is the solution that uses the IDXDataErrorInfo interface
            UPDATE:
            The latest and more complete solution is available at UI Annotation using Business Rules
            Thanks,
            Dennis

              Show previous comments (25)
              CR CR
              Chris Royle (LOBS) 12 years ago

                Thanks Tolis - very helpful.

                CR CR
                Chris Royle (LOBS) 12 years ago

                  For people following this issue, Dennis has been hard at work: http://dennisgaravsky.blogspot.com/2013/07/developing-validation-warnings-feature.html

                  Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

                  Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.