# condition on form save

**URL:** <https://www.dynamicsuser.net/t/condition-on-form-save/40217>\
**Category:** Developer Forum\
**Created:** [September 12, 2012, 7:45am UTC](https://www.dynamicsuser.net/t/condition-on-form-save/40217 "2012-09-12T07:45:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![K.manish](https://avatars.discourse-cdn.com/v4/letter/k/a8b319/32.png) [@K.manish](https://www.dynamicsuser.net/u/K.manish)\
**Post date:** [September 12, 2012, 7:45am UTC](https://www.dynamicsuser.net/t/condition-on-form-save/40217/1 "2012-09-12T07:45:15Z")

</div>

hi friends ,

is it possible to apply conditions when saving/closing the form?

when i create new line , i have to check one amoung the 3 check boxes should be checked, otherwise it should display message and not allow to save.

thanks

Manish

---

<div class="post-metadata">

**Author:** ![sureshkumar552](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@sureshkumar552](https://www.dynamicsuser.net/u/sureshkumar552)\
**Post date:** [September 12, 2012, 8:09am UTC](https://www.dynamicsuser.net/t/condition-on-form-save/40217/2 "2012-09-12T08:09:25Z")

</div>

Hi manish,

i think it is possible call the override method “CLOSE”…it will check before closeing form…

I hope this is some more helpful to you…

---

<div class="post-metadata">

**Author:** ![K.manish](https://avatars.discourse-cdn.com/v4/letter/k/a8b319/32.png) [@K.manish](https://www.dynamicsuser.net/u/K.manish)\
**Post date:** [September 12, 2012, 9:47am UTC](https://www.dynamicsuser.net/t/condition-on-form-save/40217/3 "2012-09-12T09:47:35Z")

</div>

hi suresh,

thanks for reponse,

but how to apply condition ?

if i have two checkboxes c1 and c2 , if none of them are checked then it wont allow to save ( show some message ) else allow to save.

my form has 3 datasources.

thanks.

---

<div class="post-metadata">

**Author:** ![MartinDrab](https://avatars.discourse-cdn.com/v4/letter/m/e0b2c6/32.png) [@MartinDrab](https://www.dynamicsuser.net/u/MartinDrab)\
**Post date:** [September 12, 2012, 3:11pm UTC](https://www.dynamicsuser.net/t/condition-on-form-save/40217/4 "2012-09-12T15:11:45Z")

</div>

If you wanted to check something before closing the form, you could use canClose() method. Don’t also forget that you have several ways of closing a form, some of them treated as cancellation.

But what you seem to want is really conditional _saving_ of a record, it’s too late when the form is closing. FormDataSource’s validateWrite() is the right method to modify.
