I'm currently trying to set the field "ListIndentLevel"
I've tried doing this a couple different ways, such as:
exception["ListIndentLevel"] = commitmentException.IndentLevel;
When doing this I keep getting hit with a "Cannot access member" exception. How do I set this?
It appears the typical way to change the level of indentation is by passing a new phrase into IncreaseIndent() or DecreaseIndent(). Also adding a child phrase to an existing phrase will increase the level of indent.
- In this example, I navigate down to a previously created loan policy and get the Exceptions list.
- Next I create an Exception object, initialize its properties then add it to the list of exceptions.
- Then I create a second exception and set the Code property to one that exists in a lookup code. All we have to do is set the Code and the remainder is set from lookup table information.
- The final exception is where I create a child. All that means is it will be indented a single level under its parent. I add the new exception to the Phrases collection of the existing exception that is to be the parent.
- The final step is to save the order changes.
Code: Select all
// IOrderItem title = (IOrderItem)order.GetProperty("Title"); IOrderItem tic = (IOrderItem)((IList)title.GetProperty("TitleInsuranceCalculations")); IOrderItem lp = (IOrderItem)tic.GetProperty("LoanPolicy"); IList exceptions = (IList)lp.GetProperty("Exceptions"); // Set both Code, Text and Comment properties. IOrderItem ex = order.CreateNew("Exception"); ex["Code"] = "PE1"; ex["Text"] = "Policy exception 1"; ex["Comment"] = "Policy exception 1 comment"; exceptions.Add(ex); // Only need to set Code since it is in lookup table and Text will be filled in automatically. ex = order.CreateNew("Exception"); ex["Code"] = "A100"; exceptions.Add(ex); // Make next one child (indented) by adding it to parent Phrases collection. IOrderItem child = order.CreateNew("Exception"); child["Code"] = "A105"; ((IList)ex["Phrases"]).Add(child); IOrderStore os = (IOrderStore)order.GetService(typeof(IOrderStore)); os.ApplyChanges(order);