Question
field condition
Hello everyone,
Here is the code for a field. When the user gives an input, there are some controls that should be verified. I want to add some code so that if the user gives an input that doesn't satisfy the condition, the field should be initialized as empty. How can I do this, please?
a!integerField(
label: "Montant Apport",
labelPosition: "ABOVE",
placeholder: "Donner le montant exact de l'apport",
value: ri!record['recordType!{3e104763-60d6-49a4-8cdb-405e073de678}PBY prêt.fields.{0f648b9f-079f-483f-87ad-d8a64c53802e}montantApport'],
saveInto: ri!record['recordType!{3e104763-60d6-49a4-8cdb-405e073de678}PBY prêt.fields.{0f648b9f-079f-483f-87ad-d8a64c53802e}montantApport'],
required: true(),
validations: {
if(
and(
not(isnull(ri!record['recordType!{3e104763-60d6-49a4-8cdb-405e073de678}PBY prêt.fields.{0f648b9f-079f-483f-87ad-d8a64c53802e}montantApport'])),
not(isnull(ri!record['recordType!{3e104763-60d6-49a4-8cdb-405e073de678}PBY prêt.fields.{5c6f5fa8-85d3-4b23-af45-80a1b6b0c364}montantPret']))
),
if(
ri!record['recordType!{3e104763-60d6-49a4-8cdb-405e073de678}PBY prêt.fields.{0f648b9f-079f-483f-87ad-d8a64c53802e}montantApport'] < (0.2 * ri!record['recordType!{3e104763-60d6-49a4-8cdb-405e073de678}PBY prêt.fields.{5c6f5fa8-85d3-4b23-af45-80a1b6b0c364}montantPret']),
"Le montant de l'apport doit être au moins égal Ã%A0 20% du montant demandé pour le prêt.",
null
),
null
)
}
),
