Hi,

your suggestions #2 and #3 would work against the weak typed character of the language. I.e. a method like this:

ClassMethod test() as %String { q 23}

Will work perfectly fine, no matter if you use the return value a string or integer. You can actually also return values from methods that don't define a return type at all.
As you already point out, changing any of this behaviour would likely break quite a lot of existing software, so it's not really feasible.

Hi Peter,

a couple of things:
* You're trying to write out the numbers twice. Everything that is >60 is also >30.
* The css style for background is background-color. See CSS reference

This works for me:

Method SetAlertColor(pTable As %ZEN.Component.tablePane, pName As %String, pSeed As %String) As %Status
{
    s val=%query(pName),col=""
    if (val>60)
    {
        s col="#FF0000"
    } elseif val>30{
        s col="#FF6600"
    } else {
        s col="#AAAAAA"
    }   
    &html<<div style="background-color:#(col)#">#(val)#</div>> 
    q $$$OK
}

%ToJSON() is only defined on objects extending %DynamicAbstractObject.
For example:

SAMPLES>s obj={"test":"42"}
SAMPLES>d obj.%ToJSON()
{"test":"42"}
SAMPLES>

To serialize arbitrary %Persistent/%Registered objects you'll have to use altJSONProvider
for example:

SAMPLES>s p=##class(Sample.Person).%OpenId(1)
SAMPLES>d ##class("%ZEN.Auxiliary.altJSONProvider").%WriteJSONFromObject(,.p)
{"_class":"Sample.Person","_id":1,"Name":"Love,Wolfgang A.","SSN":"917-96-1802","DOB":45275,"Home":{"_class":"Sample.Address","Street":"8360 First Street","City":"Zanesville","State":"WV","Zip":25788},"Office":{"_class":"Sample.Address","Street":"1842 Maple Court","City":"Hialeah","State":"NH","Zip":65893},"Spouse":"","FavoriteColors":[],"Age":"52"}