Persist Error and Warnings

Discussions related to SoftPro Select user interface development.

Moderator: Phil Barton

Post Reply
mlevi
Posts: 53
Joined: Mon Dec 01, 2014 2:33 pm

Persist Error and Warnings

Post by mlevi »

Hi,

We're using the code below to add an error to the "Errors and Warnings" tab.

Code: Select all

IErrorList errorList = ss.GetService<IErrorList>();
OrderUri uri = new OrderUri(order.Identifier, "");
errorList.Add("an error has occured", ErrorKind.Error, uri);
errorList.Show();
However, after adding the error to the tab, it disappears after a moment. How can this be persisted?

This code is running from a shell package.

Thanks
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Persist Error and Warnings

Post by BobRichards »

Unfortunately there is no way to do this. Unless the user "pins" the window, it will close automatically.
Bob Richards, Senior Software Developer, SoftPro
mlevi
Posts: 53
Joined: Mon Dec 01, 2014 2:33 pm

Re: Persist Error and Warnings

Post by mlevi »

Thanks Bob for your help.

We're actually running into another issue.

We've got a INotifyPropertyChanged handler that based on certain conditions, adds a warning to the Errors and Warnings tab. The warning appears on the tab, but after a moment it is removed from the list.

How can we get that to appear as long as the order is open?
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Persist Error and Warnings

Post by BobRichards »

What else is going on at the time?
Bob Richards, Senior Software Developer, SoftPro
mlevi
Posts: 53
Joined: Mon Dec 01, 2014 2:33 pm

Re: Persist Error and Warnings

Post by mlevi »

To my knowledge nothing else.

The handler is bound when the order is opened, and when the specified property is changed the handler fires. Some conditions are checked and if they are satisfied, we just add the warning to the error list. We don't have any code that would clear the IErrorList.

We did have some test packages registered on the development hive, but we've unregistered those so I don't think that there is other code running from another package.

I'm not sure though if I got the moniker right. Does it need to point to the specific property/field, or is enough if it's pointing to the order?

Thanks
joe.mag
Posts: 122
Joined: Thu Aug 04, 2011 3:11 pm

Re: Persist Error and Warnings

Post by joe.mag »

Has there been a resolution to this issue? I'm seeing the same thing in 4.0.3032.25. Specifically--my error or warning does appear in the Errors and Warnings list but only for a few seconds and then it vanishes. I've tried playing around with the 2nd parameter of Uri ctor (screen name) but it's unclear what format the screen name and possible field name should take.
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Persist Error and Warnings

Post by BobRichards »

I have been unable to reproduce your issue. Do you close close any of the orders in your package? Is it possible that the error (since it is placed on an IOrderItem) becomes resolved shortly after you add it to the list due to order modifications made by other logic such as a second package?

When I use the code fragment posted on 2/3/15, I do not have any issues. The error continues to be displayed in the error list.
Bob Richards, Senior Software Developer, SoftPro
joe.mag
Posts: 122
Joined: Thu Aug 04, 2011 3:11 pm

Re: Persist Error and Warnings

Post by joe.mag »

I do not close orders in my package. The errorlist code is in a button handler that performs a rather lengthy process that include writing values to custom fields. If I comment out the time-consuming code then the errorlist code works just fine--the error appears in the list and it remains visible. However, if I re-enable the time-consuming code then I see the "appear then vanish" behavior almost like a race condition.

Also, I noticed on an order that triggers a SoftPro validation rule ("prior policy coverage amount is greater than the policy coverage amount") my added error messages work even with the time-consuming code in place.
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Persist Error and Warnings

Post by BobRichards »

All I can recommend without seeing the entirety of your code is to comment out the lengthy portion of your code, then re-enable pieces until you find the sensitivity.
Bob Richards, Senior Software Developer, SoftPro
Post Reply