HotSpot Address or Contact
Moderator: Phil Barton
HotSpot Address or Contact
I did a Raise Warning event --> e.AddWarning(e.Order, "Address1", reason), and I want to HotSpot for the 2nd address lets say or specific Contact. How can I do this?
-
- Posts: 1382
- Joined: Wed Jan 15, 2014 3:50 pm
- Location: Raleigh, NC
- Contact:
Re: HotSpot Address or Contact
The AddWarning(item, property, message) and AddError(item, property, message) method work the same way. The first argument (the context) must be an IOrderItem. The second argument is a member Property for the context. The Context and Property information is displayed in Select in the Field Code Browser when you select an order field. Alternatively, you can press ALT+F6 in a field to see this information.
Code: Select all
void Handler(object o, OrderSavingEventArgs e)
{
// Get the address IOrderItem for the second underwriter (NO ERROR CHECKING).
IOrder order = e.Order;
IList underwriters = (IList)order.GetProperty("Underwriters");
IOrderItem underwriter = (IOrderItem)underwriters[1];
IOrderItem address = (IOrderItem)underwriter.GetProperty("Address");
// Add warning.
e.AddWarning(address, "Address1", "Bad address");
}
Bob Richards, Senior Software Developer, SoftPro