Hi,
I'm currently trying to set the field "ListIndentLevel"
I've tried doing this a couple different ways, such as:
exception.SetProperty("ListIndentLevel", commitmentException.IndentLevel);
and
exception["ListIndentLevel"] = commitmentException.IndentLevel;
When doing this I keep getting hit with a "Cannot access member" exception. How do I set this?
Thanks!
Setting ListIndentLevel
-
- Posts: 1380
- Joined: Wed Jan 15, 2014 3:50 pm
- Location: Raleigh, NC
- Contact:
Re: Setting ListIndentLevel
ListIndentLevel is a readonly property to indicate the current level of indentation.
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.
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.
Bob Richards, Senior Software Developer, SoftPro
Re: Setting ListIndentLevel
Thank you for the swift response Bob. Would you be able to show a quick example of passing a new phrase into IncreaseIndent() or DecreaseIndent()?
-
- Posts: 1380
- Joined: Wed Jan 15, 2014 3:50 pm
- Location: Raleigh, NC
- Contact:
Re: Setting ListIndentLevel
I'm glad you spoke up for an example. I was leading you down a long hole. The best way to create lists of Exceptions, Requirements, and Subordinate Matters is demonstrated below.
The hardest part to remember is that all of these types of objects (Exception, Requirement, EndorsementException, EndorsementRequirement, and Subordinate Matters) have a Phrases collection. Add the the Phases to create children (a.k.a. indent to the right).
- 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"))[0];
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);
Bob Richards, Senior Software Developer, SoftPro
Re: Setting ListIndentLevel
That makes a lot of sense. I think Ill be able to utilize this to implement my solution. Thanks for the fast and detailed responses!