ValidationMessage

Discussions related to custom development with Select.
Post Reply
HariK
Posts: 25
Joined: Wed Feb 23, 2011 4:15 pm

ValidationMessage

Post by HariK »

In 2.6, if there are warnings and/or errors, they were returned in the ValidationMessage[] parameter

Code: Select all

                        //Softpro 2.6
                        ValidationMessage[] messages;
                        orderTracking.SaveOrder(order, out messages);
How are warning messages returned to the caller in 3.0? please confirm
john.morton
Posts: 89
Joined: Wed Nov 16, 2011 11:51 am

Re: ValidationMessage

Post by john.morton »

The IOrder interface has a GetMessages method which returns IEnumerable<IOrderMessage> as shown...

Code: Select all

foreach(IOrderMessage error in order.GetMessages().Where(m => m.Level == OrderMessageLevel.Error))
{
      MessageBox.Show(error.Text, "An Error Occurred");
}
Post Reply