Formula Coding

Questions about and code samples for automation process code snippets within Select.
Post Reply
cklahr
Posts: 71
Joined: Tue Oct 27, 2009 3:32 am

Formula Coding

Post by cklahr »

Hi,

The below code isn't giving me the desired results. Any idea what the issue can be? It works well if only one of the paragraphs are in. Otherwise, it checks only the last one? How can I have it check all if necessary?

Thank you very much!

Code: Select all

value = ""

Iterate {{Order.Buyers}} From 1 To #{{Order.Buyers}}
IF ((@.BankruptcyDistrictResults## = "no records") AND  (@.District## <> {{Order.Properties[1].BankruptcyDistrict#}})) Then
value = True
Else
value = False
EndIf
Break
Loop

Iterate {{Order.Sellers}} From 1 To #{{Order.Sellers}}
IF ((@.BankruptcyDistrictResults## = "no records") AND  (@.District## <> {{Order.Properties[1].BankruptcyDistrict#}})) Then
value = True
Else
value = False
EndIf
Break
Loop

Iterate {{Order.Others}} From 1 To #{{Order.Others}}
IF ((@.BankruptcyDistrictResults## = "no records") AND  (@.District## <> {{Order.Properties[1].BankruptcyDistrict#}})) Then
value = True
Else
value = False
EndIf
Break
Loop
kkellett
Posts: 14
Joined: Thu Sep 25, 2008 8:51 am
Location: Raleigh, NC
Contact:

Re: Formula Coding

Post by kkellett »

Hello,

When the formulas are stacked this way, the last one will "win" over the others. If we join the coding so it checks all of the contacts this should work:


value = ""

Iterate {{Order.Buyers}} From 1 To #{{Order.Buyers}}
IF ((@.BankruptcyDistrictResults## = "no records") AND (@.District## <> {{Order.Properties[1].BankruptcyDistrict#}})) Then
value = True
Else

Iterate {{Order.Sellers}} From 1 To #{{Order.Sellers}}
IF ((@.BankruptcyDistrictResults## = "no records") AND (@.District## <> {{Order.Properties[1].BankruptcyDistrict#}})) Then
value = True
Else

Iterate {{Order.Others}} From 1 To #{{Order.Others}}
If ( @.OtherType = "Prior Owner w/o$" Or @.OtherType = "Guarantor" Or @.OtherType = "Name on application" Or @.OtherType = "Name Requested") Then
IF ((@.BankruptcyDistrictResults## = "no records") AND (@.District## <> {{Order.Properties[1].BankruptcyDistrict#}})) Then
value = True
EndIf
EndIf
Loop
EndIf
Loop
EndIf

Loop
cklahr
Posts: 71
Joined: Tue Oct 27, 2009 3:32 am

Re: Formula Coding

Post by cklahr »

Thank you very much!!
Post Reply