I wrote the following monster compound if statement.  It works and produces the correct results, but my instincts say there is a better way, but my Boolean logic doesn't seem to be up to the task.  Anybody want to see if they can trim this beast down to a more elegant solution? Just to say that you did it!

<cfif session.cps.profile.complaints.getStatus() EQ "ACCEPT" AND
(
( Complaint.KCC_REG_FLG EQ "N" AND
  Complaint.KCC_APPROVE_FLG EQ "N" AND
  NOT ActiveApprovals.RecordCount AND
  NOT ActiveReviews.RecordCount
)
OR
( Complaint.KCC_REG_FLG EQ "N" AND
  Complaint.KCC_APPROVE_FLG EQ "Y" AND
  NOT ActiveApprovals.RecordCount AND
  FinalApprovals.RecordCount AND
  NOT ActiveReviews.RecordCount
)
OR
( Complaint.KCC_REG_FLG EQ "Y" AND
  Complaint.KCC_APPROVE_FLG EQ "Y" AND
  NOT ActiveApprovals.RecordCount AND
  FinalApprovals.RecordCount AND
  NOT ActiveReviews.RecordCount AND
  FinalReviews.RecordCount
)
)
>

Show a section of display only if at least one of the above three cases is completely true.

</cfif>

Have fun.

--------------
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

"C code. C code run. Run code run. Please!"
     - Cynthia Dunning
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to