How to search an Order's Notes ?
Posted: Fri Feb 26, 2021 4:10 pm
Hi-
SPS version 4.3.10.1
I am needing to iterate through an open Order's Notes and look at each Note's content for specific strings.
I have something like this, but the Cast to INote throws, as the items in the collection are not derived from INote.
I put a breakpoint after the "notes = ....." line and inspected the result via trying to evaluate notes[0].GetType(), and the response was that it was a Type called Note, but the namespace was not defined, so I wasn't sure how to go about drilling down to each Note's Content.
?
Thank you.
SPS version 4.3.10.1
I am needing to iterate through an open Order's Notes and look at each Note's content for specific strings.
I have something like this, but the Cast to INote throws, as the items in the collection are not derived from INote.
Code: Select all
var notes = _activeOrder["Notes"] as IList;
var lookingForMyFavoriteNote = notes.Cast<INote>().FirstOrDefault(note =>
{
if (note.Content.StartsWith("this", StringComparison.InvariantCultureIgnoreCase) ||
note.Content..StartsWith("that", StringComparison.InvariantCultureIgnoreCase))
{
return true;
}
return false;
}
?
Thank you.