Application Studio Event Condition Syntax

Experimenting with adding event handlers in Application Studio…

I am creating a trigger event, “before”, “OnClick_ToolSave”

For the Condition step properties there is “Advanced”, then “Param”, then “Expression”

The tooltip on Expression is:
Provide the expression that has to be evaluated. e.g.: “[OrderDtl.PartNum]” === “TSHIRT”

Is there documentation for possible syntax options for building an expression ?
(I couldn’t find it)

The wizards in classic (e.g. Row Rules) were much nicer for this kind of thing,
you know, stuff like, pick a table, pick a field, pick a condition (<, >, equals, etc), specify the value.
(and in Classic, Method Directives setting up a condition is friendly)

I would like to understand syntax for things like:
Why quotes around the brackets for table.field name ?
Why 3 = signs ? (not standard in any programming language I know of)
Do I always need quotes around the value or only if it’s a string type ?
Are there other condition types that are based on something other than table.field ?

Javascript :face_vomiting:
# Strict equality (===)

2 Likes

I did figure this out finally, the tooltip looked like “[OrderDtl.PartNum]” but in reality was “{OrderDtl.PartNum}”

Because you’re comparing strings.

Nope. TransView.SomeIntField == 0 is fine too. Note–you don’t always have to use strict equality (===)

Sure. For instance if you want to do some action off if a dataview has rows or not. %dataViewName.count%
Actually, I think just doing %dataViewName% works as well.

3 Likes

How to write expression for no equal to “!=” condition?

Yes, since we are in javascript land either != or !==

1 Like

Hello @hmwillett,

I have a case where I want to validate if the field in transview is equal to empty when pressing a button, a message should be displayed.

However, this never happens.

I have the field and the button with its respective epBinding assigned correctly.

Use sintax: "{TransView.NuevoNumero}"===""

I find the solution.

What happens is that initially when the field has not been placed any value, its default state or type is undefined and later when values are entered and deleted, it could be left with an empty string state.

Then I made a validation, where if the field is not undefined and if it is not empty.

"{TransView.field}" !== "undefined" && "{TransView.field}" !== ""