Hi guys ! In my app, when i create a record i...

(Lavanderias El Sol) #1

Hi guys ! In my app, when i create a record it has status is active “A” , and i can edit and change all fields, i have a “Valid If” that

validate the status = “A” to do that.

To make another record i need to close this, i have an “action” that change the status to “C”, only one record is active “A” at a time, but …

the action does not work because it says that “IS BECOME INVALID”,

Then,

how i validate that only record “A” can edit, or how can i change the status to a record without going against the validation???

thanks for your help…

(Dinh Nguyen Nguyen) #2

@Efren Hi, I’m afraid I don’t quite understand the problem. Could you give me a step-by-step example please? Also, what are the names of the app and the relevant tables, columns, and actions?

(Lavanderias El Sol) #3

the app is “CorteV2SINDATA-261468” in a simple way, with a single table …

I have two employees, one in the morning and another in the afternoon. each employee generates a record in table “CORTE”, when the employee leaves, closes his record with an “action” that changes [sts]

= C, the employee who enters makes a new one with [sts] = A.

The idea is that you can not edit anything from a “closed” record [sts] = c, but you can see it.

I put in filed [ID DATE] “valid_if” = OR (NOT (IN ([INT KEY], CUT [INT KEY]), [STS] = A) so that the records can not be edited [sts] = c, but the problem is that when the “action” wants to change the [sts] = c it says it’s invalid!

The action

name is “CERRAR CORTE”

temporarily to work, I modify the valid_if = OR (NOT (IN ([INT KEY], CUT [INT KEY]), [STS] = A, [STS] = C)

(Aleksi Alkio) #4

I asume you have removed that validation away temporarely but the reason could be this… The [STS] should not have any validation by itself. The [FEC Close] should not have validation as well, because it’s hidden field in the form. Then your “Cerrar Corte” action (sequence of actions) is able to write the NOW().