Question
Hello! I want the action code to trigger when a user edits a cell directly. In the action code, I check the validity of the new value. On the other hand, the value in the cell can be generated and set via Cron, and in that case, I wouldn't want to perform validation since the generated value is definitely valid, and validation is a heavy operation. Is there a way to achieve this?
Answer
To do this, the first action in the Cron code should be to set a process variable.
Cron code in the cron table:
a1=: procVar(name: "is_cron"; value: true)
a2=: set(table: 'some_table'; field: 'field_with_validation' = "new_value"; where: 'id' = 10; log: true)
In the field action code where the validity check is performed:
=: if(condition: $@is_cron = false; then: $check)
check: "here validation code"