Selecting CDF Line for a HOA Charge/Proration via API

Discussions related to custom development with Select.
Post Reply
ckootg
Posts: 122
Joined: Fri Jan 06, 2012 6:10 pm

Selecting CDF Line for a HOA Charge/Proration via API

Post by ckootg »

On the HOA Charges & Prorations screen, you can select the line the charge/proration appears on, ie., K.12/M.13. How can I do this via the API?

The CDFLine property on the HOACharge object is protected, so I can't assign that way.

I also tried assigning the charge to the CDF line:

Code: Select all

var dueFromBuyerSummaryCharge = <get charge>;
var dueToSellerSummaryCharge = <get charge>;
var lineK12 = GetLine("K.12");
var lineM13 = GetLine("K.13");
lineK12.Charges.Add(dueFromBuyerSummaryCharge);
lineM13.Charges.Add(dueToSellerSummaryCharge);
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Selecting CDF Line for a HOA Charge/Proration via API

Post by BobRichards »

In the example below, I already created an endorsement and am changing the line the charge goes to. The trick is to set the "CDFLine" on the endorsement to the desired line. HUDs and Commercial (CSS) settlement types will have a different process to follow, but these are the CDF steps. Also, see the SDK for other variants of the "NextAvailableLine()" method if you need additional options.

Code: Select all

// Open CDF order - will be slightly different for CSS and very different for HUD.  
IOrderStore os = ss.GetService<IOrderStore>();
IOrderInfo orderInfo = os.Orders.Where(t => t.Number == orderNumber).First();
using (IOrder order = os.OpenOrder(orderInfo, OrderEditMode.ReadWrite))
{
	// Get the desired line from the first CDF.  If line doesn't exist, add a new one.
	IList cdfs = (IList)order.GetProperty("CDFs");
	IOrderItem cdf = (IOrderItem)cdfs[0];
	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.
		//  NOTE: Endorsements may only be added to Section B, C, and H by default.
		line = ((dynamic)cdf).NextAvailableLine(CDFSectionType.ServicesShoppedFor);
	}

	// Endorsement has already been created and is part of the order.
	//  Change its line property to your line.
	IOrderItem title = (IOrderItem)order.GetProperty("Title");
	IList endorsements = (IList)title.GetProperty("Endorsements");
	IOrderItem endorsement = (IOrderItem)endorsements[0];
	endorsement.SetProperty("CDFLine", line);

	// Save order.
	os.ApplyChanges(order);
}
Bob Richards, Senior Software Developer, SoftPro
ckootg
Posts: 122
Joined: Fri Jan 06, 2012 6:10 pm

Re: Selecting CDF Line for a HOA Charge/Proration via API

Post by ckootg »

Thanks. That worked. Had to set the CDF line on the proration level, not charge level.

The NextAvailableLine method worked too, but I couldn't find it in the SDK help.
patel
Posts: 7
Joined: Mon Mar 30, 2020 3:51 pm

Re: Selecting CDF Line for a HOA Charge/Proration via API

Post by patel »

Hi Bob,

I know this is old topic, but can you give me an example to get next credit/debit line using NextAvailableLine(). I looked at the SDK doc but dint find anything

Thank you
Parth
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Selecting CDF Line for a HOA Charge/Proration via API

Post by BobRichards »

Please see the topic Getting the NextAvailableLine() for your answer. I split it out since I have plans to add more settlement statment types as needed for the same functionality.
Bob Richards, Senior Software Developer, SoftPro
patel
Posts: 7
Joined: Mon Mar 30, 2020 3:51 pm

Re: Selecting CDF Line for a HOA Charge/Proration via API

Post by patel »

Hi Bob,

Thanks for the reply.

I was trying to get next credit debit like for Section K and L (Like give me next available credit/debit line for those sections) or just a regular line, is this possible with above method ?

Thanks,
Parth
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Selecting CDF Line for a HOA Charge/Proration via API

Post by BobRichards »

As a general rule, if you can't do it from the Select UI, you can't do it from the API. After reviewing the code, it appears you cannot add to sections: K, L, M, and N.
Bob Richards, Senior Software Developer, SoftPro
Post Reply