Order.Title.AdditionalCharges

Discussions related to custom development with Select.
Post Reply
Jared4Surf
Posts: 5
Joined: Mon Feb 27, 2017 7:52 pm

Order.Title.AdditionalCharges

Post by Jared4Surf »

Hello!

I am looking to add "Additional Title Charges" to our orders. We currently "read" and record them from dynamicOrder.Title.AdditionalCharges thru the API.

We have been able to add charges and fees to other parts of the order, largely following the post "Adding lines and charges to CDF" on this very site.
https://devforum.softprocorp.com/viewto ... 830&p=3562

But I can find no direction on adding a Line and Charge to "Additional Title Charges".

Also, I realize that when using the UI this also "creates a line" in one of the actual "Sections" of the order. (Or "lines" in the case of HUD) A quick overview on how this might be specified would help very much!

Thanks in advance!
Jared
BobRichards
Posts: 1377
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Order.Title.AdditionalCharges

Post by BobRichards »

Setting the "CDFLine" property on the ATC (AdditionalCharges object) should be handled the way you would to a LP/OP policy or endorsement. Have you assigned lines to any of these types?
Bob Richards, Senior Software Developer, SoftPro
Jared4Surf
Posts: 5
Joined: Mon Feb 27, 2017 7:52 pm

Re: Order.Title.AdditionalCharges

Post by Jared4Surf »

No, we have only had to read Policies and Endorsements, thus far.
Is there a page on this forum that describes it?
I will poke around, but I would still think I would need the keyword to create the type, which I cannot find.

Jared
BobRichards
Posts: 1377
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Order.Title.AdditionalCharges

Post by BobRichards »

Take a look here. The response shows how to set the CDFLine for an endorsement - which is the same process.

Let me know if you need something more explicit. Gook luck!
Bob Richards, Senior Software Developer, SoftPro
Jared4Surf
Posts: 5
Joined: Mon Feb 27, 2017 7:52 pm

Re: Order.Title.AdditionalCharges

Post by Jared4Surf »

Bob,

Thanks for your response.

1. That is a great answer to my second question, which is how to set the CDF line. And when I look at the existing Title.AdditionalCharges in the order, that seems plain enough. Plus there is the "get next available", which is great.

2. Unfortunately, I still do not know how to add one for Title.AdditionalCharges... I will use "OtherCostSection" of the type "OtherCosts" as an example:
After trying to find a line, we think should exist called "detailLine"...
if (detailLine == null)
{
detailLine = order.CreateNew("OtherCostDetailLine");
if (detailLine.Charges.Count == 0)
{
dynamic newCharge = order.CreateNew("OtherCostDetailCharge");
detailLine.Charges.Add(newCharge);
}
CDF.Lines.Add(detailLine);
}

We then update the properties Contact, SellerPaidAtClosing, and Description, and store the guid somewhere else.

I'd merely like the parallel for Title.AdditionalCharges ... something with keywords like this?...

if (thischarge == null)
{
thischarge = order.CreateNew("AdditionalChargeDetailLine");
CDF.Title.AdditionalCharges.Add(thischarge);
}

I don't know where to get the keywords like "AdditionalChargeDetailLine" and I'd merely be experimenting with how to add after constructing, I'd really prefer a sample.

Thanks again for the CDF part, that will help! And thanks for helping me to add Additional Title Charges!

Jared
BobRichards
Posts: 1377
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Order.Title.AdditionalCharges

Post by BobRichards »

This code will create a new Additional Title Charge on a CDF. By the way, the hint for for the object name to get from order.CreateNew() is found when you look at an ATC with the Field Code Browser. When you select "Title/AdditionalCharges" and look at the bottom of the screen, it says the type is a "Collection(Of AdditionalTitleCharge)". That means you should request a new "AdditionalTitleCharge" (this throws a lot of devs). It's not full-proof, but it is the best place to start.

Code: Select all

public CreateATC(SelectServer ss)
{
    // Open CDF order.  
    IOrderStore os = ss.GetService<IOrderStore>();
    IOrderInfo orderInfo = os.Orders.Where(t => t.Number == "XAT19000029").First();
    using (IOrder order = os.OpenOrder(orderInfo, OrderEditMode.ReadWrite))
    {
        // Get the first CDF.
        IList cdfs = (IList)order.GetProperty("CDFs");
        IOrderItem cdf = (IOrderItem)cdfs[0];

        // Get a line to send the ATC charge to.
        var lines = cdf.GetProperty("Lines") as IEnumerable<IOrderItem>;
        var line = lines.Where(t => (string)t.GetProperty("SectionNumber") == "H.05").FirstOrDefault();
        if (line == null)
        {
            // No line - create it.
            line = ((dynamic)cdf).NextAvailableLine(CDFSectionType.ServicesShoppedFor);
        }

        // Create new ATC and add it to ATC collection before changing properties.
        IOrderItem title = (IOrderItem)order.GetProperty("Title");
        IList additionalTitleCharges = (IList)title.GetProperty("AdditionalCharges");
        IOrderItem newATC = order.CreateNew("AdditionalTitleCharge");
        additionalTitleCharges.Add(newATC);

        // Set properties...
        newATC.SetProperty("Description", "A new ATC!");
        newATC.SetProperty("CDFLine", line);

        // Save order.
        os.ApplyChanges(order);
    }
}
Bob Richards, Senior Software Developer, SoftPro
Jared4Surf
Posts: 5
Joined: Mon Feb 27, 2017 7:52 pm

Re: Order.Title.AdditionalCharges

Post by Jared4Surf »

Bob,

First, thanks for the call, I appreciate you reaching out to get the thing understood and done.

Second, this code is exactly what I needed thanks.

Last, I had no idea what a Field Code Browser was, I was doing all of my work via example, or exploring objects through the API. Teach a man to fish! It took me about an hour to figure out where it was in SoftPro. This is a valuable tool. (If anyone else is looking for it - as I found several references on the boards - it is in the Order Menu, under Document History!)

You can close this one! THANKS!

Jared
Post Reply