Display Method on Form

Hello friends.

I’am new here, this is my firts post.

Please help me with this question:

A made display method on a Table, which return default Image on Form ,something like

display ImageRes infologImage()

{

#resappl

return #Image_OK;}

I also have a class, calling from this form, which make some calculation. If something goes wrong, I’d like to change return value to #Image_Error.

Can i call this display method on class and somehow override return value to #Image_Error?

AX itself calls the method when it needs a value to display - if you call the method, you merely obtain the value. Nevertheless the display method can refer to an instance of your class and get the value from there. Like this:

display ImageRes infologImage()
{
    #resAppl

    if (myClass.failed())
    {
        return #Image_Error;
    }
    else
    {
        return #Image_OK;
    }
}

Martin, thanks for your help.