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
CDF Lines in Formula
Moderator: Phil Barton
-
- Posts: 1377
- Joined: Wed Jan 15, 2014 3:50 pm
- Location: Raleigh, NC
- Contact:
Re: CDF Lines in Formula
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
Bob Richards, Senior Software Developer, SoftPro
-
- Posts: 27
- Joined: Wed Sep 26, 2018 1:24 pm
Re: CDF Lines in Formula
This is exactly what I needed, thank you!
-
- Posts: 27
- Joined: Wed Sep 26, 2018 1:24 pm
Re: CDF Lines in Formula
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
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
-
- Posts: 27
- Joined: Wed Sep 26, 2018 1:24 pm
Re: CDF Lines in Formula
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?