Question
· Oct 1, 2021

DTL Compile Error In Management Portal Not in Studio

I have a requirement which comes down to evaluating two fields, if they are both empty then provide a default value.

If one is empty but the other has a value, then set the empty one to the field with a value.

The screenshots are not the actual fields, I was just using the dtl and fields to prove out the solution.

When I saved and compiled in the Management Portal I got an error, but it still compiled.

I then went to studio and opened the dtl, using view-->other code then compiled and did not get the error.

Wondering if this is a true error or just an anomaly?

The code does at least through the testing tool, perform as desired.

Thanks,

Product version: IRIS 2020.1
Discussion (4)1
Log in or sign up to continue

So, on re-reading your question and looking at your example, I'm wondering whether you really wish to check whether the fields are empty, or that they contain more than 1 character? A single character value isn't "empty" and your expression will return true if either field has zero or 1 character in it.

If you're simply checking for a condition where both fields are empty, this is a solution:

'(..Length(source.LABRSLTNUMRSLTVAL) && ..Length(source.TSTRLTVAL))

Or this, which is a bit closer to what you had come up with:

'(..Length(source.LABRSLTNUMRSLTVAL)) && '(..Length(source.TSTRLTVAL))

A non-zero numeric return value evaluates to true, so no need to provide a comparison operator for the individual length checks.