PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WINDEV 2024 → Validation of fields in a Table
Validation of fields in a Table
Iniciado por brys, abr., 26 2024 2:20 PM - 2 respostas
Membro registado
3 mensagems
Publicado em abril, 26 2024 - 2:20 PM
Hello, I have a Table control directly bound to a data file.
I want to be able to make some validations before the user input is sent to the database.
I'm struggling to understand what I should do and where.

Can you help me?
Membro registado
2 mensagems
Publicado em abril, 27 2024 - 6:56 AM
With high likliness you want to do somthing in the Whenever Modifying even
or in the Deactivate Event, maybe you want to save some state while activating

// In Entry of the Column
vSavedVal = MySelf


// In whenever modifying Control
IF MySelf = "Test" THEN
Info("I don't like that value, resetting");
MySelf = vSavedVal
END
Membro registado
122 mensagems
Publicado em abril, 29 2024 - 7:52 AM
//Exit from a row of <TableControl>

//Sample avoid same Values on two Fields
IF MySelf.InputInProgress() THEN
IF COL_Field1 = COL_Field2 THEN
Error("Fields cannot have the same Value")
ReturnToCapture()
END
END