Hi,
I'm trying to figure out how to get the very last phrase in a commitment exception with nested phrases.
For example:
I have a list of exceptions and Ill get the last exception in the list of exceptions as such,
IOrderItem previousException = (IOrderItem)newExceptions[newExceptions.Count-1];
Lets say this returns an exception that has a child phrase, and that child phrase is another exception, and then that child has a phrase that is an exception. How would I get the very last child phrase in this exception with nested child phrases (exceptions)?
Iterating through all phrases of an exception
-
- Posts: 1377
- Joined: Wed Jan 15, 2014 3:50 pm
- Location: Raleigh, NC
- Contact:
Re: Iterating through all phrases of an exception
We do not have any special search capability in this area. You will have to do it brute-force with some ugly logic. Sorry.
Bob Richards, Senior Software Developer, SoftPro
Re: Iterating through all phrases of an exception
Not a problem. More specifically I was looking for the logic to pull a child phrase from its parent.
I've tried this:
var phrases = exception.GetProperty["Phrases"];
var childException = phrases[0];
with no such luck. Would you be able to provide an example? Thanks.
I've tried this:
var phrases = exception.GetProperty["Phrases"];
var childException = phrases[0];
with no such luck. Would you be able to provide an example? Thanks.
-
- Posts: 1377
- Joined: Wed Jan 15, 2014 3:50 pm
- Location: Raleigh, NC
- Contact:
Re: Iterating through all phrases of an exception
Did you get an error? If so, what was it.
Did you cast the "exception.GetProperty["Phrases"];" to an IList so it can be indexed in the next line?
Did you cast the "exception.GetProperty["Phrases"];" to an IList so it can be indexed in the next line?
Bob Richards, Senior Software Developer, SoftPro