ulisses
ulisses

Reputation: 1581

How to jump all dialog BOX by code?

Is there a way to jump all Dialog Box in standard code?

For example if in TaxVatTable.validateWrite call a class TaxVATNumValidateES\validateVATNum and here exist a BOX and I don't want to show, is there a solution?

Exist a way to disable dialog box function in all cases?

Upvotes: 0

Views: 149

Answers (1)

Alex Kwitny
Alex Kwitny

Reputation: 11544

Yes you can, just modify the relevant methods in \Classes\Box.

The issue is those Box messages are a decision point being made by the user. So how do you know what they'll always choose? You can return the _defaultButton and probably be O-K in most cases.

They call different types of forms, but the one you're referring to is \System Documentation\Classes\DialogBox which is kernel code so the lowest point you can override it is at the Box class.

You can see how they short-circuit by doing this:

if (clientKind() == ClientType::COMObject)
    return _defaultButton;

EDIT:

I want to add that I do NOT recommend doing this. Just change the code in the locations where it's called. You'd be functionally breaking part of the framework. Other developers may NEED to call this functionality at some point.

It's used on forms and all over the place. If you just make it always return Yes, you could cause ALL sorts of problems.

Upvotes: 2

Related Questions