Hi,
i am creating an application for testing production machines.
Every machine has a list of 'Checks' that need to be done.
I have a machine table and a checks table (each control is related to a single machine).
The 'Tests' table allows to save each test have been made to a new machine and has got the reference to the 'Machine' table and the 'Controls' table.
The intention is to have an insertion form that has this behavior:
To have this behavior I applied this expression to the valid if:
IN([_THIS],
SELECT(OPERAZIONICONTROLLO[IdOperazione],[Macchina]=[_THISROW].[Macchina]) -
SELECT(Collaudi[OperazioneControllo],[Commessa]=[_THISROW].[Commessa]))
The expressions works very well in new rows, but when i want to edit a test row it tells me that the input is invalid because a row with that type of check is already saved in the 'Tests' table.
So my question is:
How can I optimize this expression without invalidating the record edit?
@Steve @Joseph_Seddik @Marc_Dillon @TeeSee1 @Aleksi @Koichi_Tsuji
Solved! Go to Solution.
SELECT(
OperazioneControllo[IdOperazione],
([_THISROW].[Macchina] = [Macchina])
)
- SELECT(
Collaudi[OperazioneControllo],
AND(
([_THISROW].[Commessa] = [Commessa]),
([_THISROW].[_ROWNUMBER] <> [_ROWNUMBER])
)
)
What about:
IN([_THIS],
SELECT(OPERAZIONICONTROLLO[IdOperazione],[Macchina]=[_THISROW].[Macchina]) -
SELECT(Collaudi[OperazioneControllo],[Commessa]=[_THISROW].[Commessa])
-LIST([_THISROW])
)
Hi Aurelian,
i tried the suggested expression but when i click Next the app still tells me the entry is invalid.
My bad. Should have been -LIST([_THIS]) instead !
IN([_THIS],
SELECT(OPERAZIONICONTROLLO[IdOperazione],[Macchina]=[_THISROW].[Macchina]) -
SELECT(Collaudi[OperazioneControllo],[Commessa]=[_THISROW].[Commessa])-
LIST([_THIS])
)
Hi Aurelien,
i tried the expression with [_THIS] but it still tells me the entry is invalid (only in edit mode).
Can you tell what is the table name and column name where is applied this valid_if expression ?
Name of the table: Collaudi
Name of column: OperazioneControllo (it's a ref column to the table OperazioniControllo)
Can anyone kindly let me know if there is a solution to this topic?
Thank you very much for your support!
@Steve @Joseph_Seddik @Marc_Dillon @TeeSee1 @Aleksi @alekseyb @Koichi_Tsuji
SELECT(
OperazioneControllo[IdOperazione],
([_THISROW].[Macchina] = [Macchina])
)
- SELECT(
Collaudi[OperazioneControllo],
AND(
([_THISROW].[Commessa] = [Commessa]),
([_THISROW].[_ROWNUMBER] <> [_ROWNUMBER])
)
)
It works!! Thank you very much!!
User | Count |
---|---|
33 | |
30 | |
30 | |
19 | |
17 |