Problem with fail

I have a field bringing in data using this formula

@Subset(@DbColumn(“Notes”:“NoCache”;“”;“RGAhide”;1); -1)

The problem is if the data being brought in is blank, the user gets an error and can not open a new form. If the blank form that was created is deleted everything is fine, but it would be a lot better if the form could still open even if a blank value was there.

Is there some kind of formula that I can enter like [failsilent] that will silent the error?

Thanks in advance!

David

Subject: Problem with fail

I a not certain what causes your failure, you don’t say. But this may prevent it from happening:

This formula returns a fixed string if the DbColumn results in an error it returns a fixed error value, if it returns an empty text list, it returns another fixed default value.

value := @Subset(@DbColumn(“Notes”:“NoCache”;“”;“RGAhide”;1); -1);

@If(@IsError(value); “(error value)”; value = “”; “(default value)”; value)

Subject: RE: Problem with fail

Sorry,

The error I am getting is

Field: ‘Lastrga’: The data types of two matching results are incompatible.

Which means that the last field that was created and saved was blank. I can’t find a formula that can fix this… or maybe I am entering it wrong :\

Thanks for your help!

Subject: RE: Problem with fail

This is caused by thr values of the (fields) that are returned from the @DbColumn() are of different types. Some may be Text and others numeric. Possibly uninitialized numbers that are returned as empty text (“”).FormulaLanguage lists must have consistent data types (Text, Number or Date/Time).

Fix that problem (ensuring that the data in the documents that you are looking up are consistent), and your problem is solved.

Subject: RE: Problem with fail

In the future, if you want to ask about an error you are getting, please include the full text of the error message. It’ll get you better answers. For that matter, search for the message text and you will probably find an explanation without having to ask!

The error occurs because @DbColumn cannot work when the column contains a mix of different datatypes – for instance, some numbers and some strings (“”).

You could either use the view selection formula to exclude the documents with blank values in that field, or use the column formula to substitute a number value if the field is blank, or change the application to prevent the dcument beig saved without a value in the field.

Morten’s solution will not work unless you’re okay with the same value being calculated veery time there is any document that has that field blank – even if it doesn’t appear at the end of the view.