V4 - Additional Title Charges - Formula to set CDF Line

Discussions concerning general integration topics.

Moderator: Phil Barton

Post Reply
BHinote
Posts: 10
Joined: Fri May 08, 2015 5:51 pm

V4 - Additional Title Charges - Formula to set CDF Line

Post by BHinote »

I am having trouble using a formula to set the CDL Line value, under Additional Title Charges.
I am trying to use something like the following, but it is complaining and will not save.
// CPL Fee for Seller, if applicable
If ( lower({{Order.TransactionType}}) <> "refinance" ) Then
Case ( {{Order.Properties[1].Address.State.Code}} )
CaseOf "IL":
Value = "C.01"
AllOthers:
EndCase
EndIf

If I just put Value = "C.01" it works, so why does it not work with the conditions.
Phil Barton
Posts: 54
Joined: Wed Sep 24, 2008 2:37 pm
Location: Raleigh, NC
Contact:

Re: V4 - Additional Title Charges - Formula to set CDF Line

Post by Phil Barton »

The issue is that you MUST return a value for a line in order for the formula to successfully execute; otherwise, the system does not know what to do with an empty value (either because it wasn't set in the formula or the Value variable was set to the empty string). For example, modifying your code a bit, this formula works:

// CPL Fee for Seller, if applicable
If ( lower({{Order.TransactionType}}) <> "refinance" ) Then
Case ( {{Order.Properties[1].Address.State.Code}} )
CaseOf "IL":
Value = "C.01"
AllOthers:
Value = "H.01"
EndCase
EndIf

What I would suggest is that for the AllOthers condition, you set value with the SelectCDFLine(...) function as follows:

// CPL Fee for Seller, if applicable
If ( lower({{Order.TransactionType}}) <> "refinance" ) Then
Case ( {{Order.Properties[1].Address.State.Code}} )
CaseOf "IL":
Value = "C.01"
AllOthers:
Value = SelectCDFLine("<whatever your default section letter is>")
EndCase
EndIf
Phil Barton
Software Architect
SoftPro
Post Reply