Match View Key Value

I need to create a new document for “Working Record” if found that no record in the database, else will display record. Why this code cannot work? Anything wrong? Appreciate in advance in any help. Thanks.

temp1 := @DbLookup(“”;“”:“”;“vsubWorking”;“branch B”;“Branch”);

temp2 := @Transform (temp1;“x”;@IsNull (temp1));

@If(temp2=false;@URLOpen(@WebDbName + “/vsubWorking/” + “branch B” + “?opendocument”); @Command([Compose];“WorkingEnt”));

Subject: Match View Key Value

When you ask why something doesn’t work, please say what it does instead of working, and exactly what you want it to do. For instance, this computed field formula doesn’t work:

CNam + “-” + CDot

What’s wrong with it?

It sounds like you want to open a Branch B document if there is one, otherwise compose a new one.

@If(@IsError(@DbLookup(“”;“”:“”;“vsubWorking”;“branch B”; 1));

@Command([Compose];“WorkingEnt”);

@URLOpen(@WebDbName + “/vsubWorking/branch%20B?opendocument”)

)

Your way of using @Transform is weird. Your expression doesn’t use the loop variable (x).