How to save a value as part of a Field Validation?


I have a requirement that I have a fileupload control where I need to set value as NULL whenever the validation fails. The validation I have added is to the fileupload field, so at present whenever I upload a wrong file there will be an error message displayed as I have added a validation specific to the field and manually I need to remove the file and upload the right one.

Instead my requirement is something like this,


label" "File Upload",

value: local!fileId,

saveInto: local!fileId,

validations: {

if(fv!files.extension = "png",{"Error to display", a!save(local!fileId,null),"")  /* Is something like this possible? or how we can achieve this */



The above scenario/question is applicable for a textfeild or any other fields also where we can change the value of the field if the validation fails.




 Discussion posts and replies are publicly visible