Display Warning message on an object

Nov 11, 2013 at 10:31 AM
Hi,

May I ask if it's possible to display a warning message on object level in NOF? For instance, if an object is created and persisted. It shows a warning message on the top of properties saying something like (e.g. The customer is not living in this address anymore etc)

Thanks,
Xiaoyi
Coordinator
Nov 11, 2013 at 10:39 AM
No. You can display warnings to the user via the Container - as I am sure you know - but these are not specifically 'associated' with an object, in the way that (I think) you want.

To do that you would really need to persist that warning. This could be on the Customer or you could be clever and have a generic domain object called, say, User Warning, polymorphically associated with any object. When that object is loaded then - via its Loaded - method you could check for any persisted UserWarnings - and, if found, then raise a new user warning via the Container. (But that might be more complex than you want!)
Nov 11, 2013 at 1:53 PM
Thanks Richard. Actually, I just added one line of code in persisted method like below

if (IsCustomerDead)
Container.WarnUser("Claimant is dead");

Basically I want to show user an warning message when they creating a claim for customer who is dead. The message is displayed on claim object.