Page 1 of 1

CDF Lines in Formula

Posted: Thu Aug 15, 2019 1:38 pm
by kendale.wyatt
I am trying to calculate the amount of the eRecording fee by counting the number of fees in CDF line E01 (Recording Fees). When I run this it just shows 1 but I actually have 3. Is there some other way to count the documents listed within line E01?

Value = 0.0
If ( {{Order.CDFs[1].TaxesAndGovernmentFeesSection.Lines.Count}} = 1 ) Then
Value = 4.00
If ( {{Order.CDFs[1].TaxesAndGovernmentFeesSection.Lines.Count}} = 2 ) Then
Value = 8.00
If ( {{Order.CDFs[1].TaxesAndGovernmentFeesSection.Lines.Count}} = 3 ) Then
Value = 12.00
If ( {{Order.CDFs[1].TaxesAndGovernmentFeesSection.Lines.Count}} = 4 ) Then
Value = 16.00
EndIf
EndIf
EndIf
EndIf

Re: CDF Lines in Formula

Posted: Thu Aug 15, 2019 4:23 pm
by BobRichards
This is an example of a formula similar to what you are trying to achieve. It was written by another programmer and looks in all the "TaxesAndGovernmentFeesSection" lines for all the CDFs. For each one it finds, it adds $15.00 to the Value variable.

Code: Select all

// eRecording Formula - Counts Documents being recorded and charges $15 per document
// Looks at the CDF Section E - If the Fee Schedule Type is "Recording" and there is an Amount being charged, charge $15 per Document
Value = 0
Iterate {{Order.CDFs}} From 1 To #{{Order.CDFs}} 
    Iterate @.TaxesAndGovernmentFeesSection.Lines From 1 To #@.TaxesAndGovernmentFeesSection.Lines
        Iterate @.Charges From 1 To #@.Charges
            Iterate @.Self{TaxAndGovernmentDetailCharge}.Fees From 1 To #@.Self{TaxAndGovernmentDetailCharge}.Fees
                If ( @.FeeScheduleType = "Recording" and Not IsEmpty(@.Amount) ) Then
                    Value = Value + 15
               EndIf
            Loop
        Loop
    Loop
Loop

Re: CDF Lines in Formula

Posted: Fri Aug 16, 2019 5:30 pm
by kendale.wyatt
This is exactly what I needed, thank you!

Re: CDF Lines in Formula

Posted: Sat Sep 07, 2019 12:57 pm
by kendale.wyatt
I am trying to do the same for the HUD lines and I am getting an error "The operator '-' cannot be applied to objects of type 'Set<HUDCharges>' and 'Int32'"

Below is the code that I am using.

// eRecording Formula - Counts Documents being recorded and charges $4 per document
// Looks at the HUD Section 1200 - If the Fee Schedule Type is "Recording" and there is an Amount being charged, charge $4 per Document
Value = 0
Iterate {{Order.HUDs}} From 1 To #{{Order.HUDs}}
Iterate @.Section1200 From 1 To #@.Section1200
Iterate @.Parent.Lines From 1 To #@.Parent.Lines
Iterate @.Charges from 1 to @.Charges
Iterate @.Self{HUD1200SectionCharge}.Fees From 1 To #@.Self{HUD1200SectionCharge}.Fees
If ( @.FeeScheduleType = "Recording" and Not IsEmpty(@.Amount) ) Then
Value = Value + 4
EndIf
Loop
Loop
Loop
Loop
Loop

Re: CDF Lines in Formula

Posted: Mon Sep 16, 2019 2:18 pm
by kendale.wyatt
Just wanted to follow up on this. I still have not been able to get the code working for the HUD. Is there some place in the formula I provided that could be keeping it from populating?