Question
MohanaPriya Vijayan · Oct 1, 2020

ERROR #00: (no error description) in Management Portal Display Mode

Hi Community,

I have a property in a class, properties Initial Expression set to 1 Property Test As %Status [ InitialExpression = "1" ];, while updating the property we have set to 0 through code. If I look the field in Logic Mode its shows 0 but in Display and ODBC mode why it shows, ERROR #00: (no error description). Does this Error cause any problem? What are the reasons for this error #00? Kindly help.

Thanks in advance.

00
0 2 46 3

Replies

Create a simple %Status like

set status = $system.Status.Error(5001, "This is an error")

and if you do 

zwrite status
status="0 "_$lb($lb(5001,"This is an error",, ....."

I cut out a significant chunk (...) because it's not relevant.

You can see that the first character in status is "0", that is because if you try a unary operator

+status, -status, 'status

 It will evaluate to the integer 0 and effectively work as a boolean flag. The part that matters is after the "0" inside the $listbuild.

The first element of $listbuild is the error code, followed by the message.

Because you set Test to 0 and nothing else, Objectscript recognizes that as a failure condition but has absolutely no information to provide beyond that. The recommendation is that you properly assign Test as a fully qualified %Status or change it to a %String where its value is equal to 

$system.Status.GetErrorText(/* some %Status instance*/)

To add to the above reply. %Status is not just a Boolean TRUE (1) or FALSE (0). It is a complex structure where if the Status is false it is represented as 0_$list(of all of the Error Information). 

If you want to display the error code in SQL then create a calculated field "ErrorMessage" along side your field that stores the %Status value. Call that field MyClass.Status. Create a new field called MyClass.StatusErrorMessage and flag it as 'Calculated'

Then in either the OnBefore Save method or using a TRIGGER  do the following:

in the ErrorTextGet() method

method StatusErrorMessage ()

{

     quit $system.Status.GetErrorText(..Status)

}

Nigel