Conditionally execute @Command

I’m trying to execute @commands from a form action. If I get a value returned from a DBlookup I open that document, if not then I open a blank form. I’ve tried @Do without success. The only other thing I can think of is to test the condition and use hide/when to present the correct action code. There must be a better way.

Thanks

Subject: Conditionally execute @Command

–>Set empty action to take DoEmpty := @Command([Compose];“blankform”);

—>Perform Lookup with catch for empty handle

Fieldname = “FieldToDCheck”

X := @DbLookup(“”:“nocache”;“”:“”;“LookupView”;LookupFieldname;3);

@If(@IsError(X); DoEmpty; X)

—>return of null value should trigger the Error

In this example 3 in the lookup is the column to search

Wil this work for you?

Subject: RE: Conditionally execute @Command

I think the problem is in the @Command([OpenDocument];UNID); itself. I can’t get it to work at all. Your code sample seems to be working.

Thanks for the reply