# Check application rules without saving

**URL:** <https://discourse.cakephp.org/t/check-application-rules-without-saving/2605>\
**Category:** Need Help\
**Created:** [May 22, 2017, 9:09am UTC](https://discourse.cakephp.org/t/check-application-rules-without-saving/2605 "2017-05-22T09:09:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manuel1948](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/manuel1948/32/2751_2.png) [@Manuel1948](https://discourse.cakephp.org/u/Manuel1948)\
**Post date:** [May 22, 2017, 9:09am UTC](https://discourse.cakephp.org/t/check-application-rules-without-saving/2605/1 "2017-05-22T09:09:03Z")

</div>

Hey dear community,

I wanted to check application rules for a generated entity, but before saving it, because I wanted to check a bunch of entities, and if all is ready to save, then I will trigger the saving progress, otherwise I want to output the errors to the user.

I do not found a way until now to check application rules from an entity, only to check the validation rule via Entity-\>errors().

Please help me.

---

<div class="post-metadata">

**Author:** ![rrd](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/rrd/32/113_2.png) [@rrd](https://discourse.cakephp.org/u/rrd)\
**Post date:** [May 22, 2017, 5:48pm UTC](https://discourse.cakephp.org/t/check-application-rules-without-saving/2605/2 "2017-05-22T17:48:32Z")

</div>

[https://book.cakephp.org/3.0/en/orm/validation.html](https://book.cakephp.org/3.0/en/orm/validation.html)

---

<div class="post-metadata">

**Author:** ![Manuel1948](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/manuel1948/32/2751_2.png) [@Manuel1948](https://discourse.cakephp.org/u/Manuel1948)\
**Post date:** [May 22, 2017, 6:04pm UTC](https://discourse.cakephp.org/t/check-application-rules-without-saving/2605/3 "2017-05-22T18:04:58Z")

</div>

Doesn’t help me, btw. I already know this page. maybe you write something more than a link, if you want to help, then help, otherwise forget it…

At the moment i do it via transactions, so that I can undo the saves.

---

<div class="post-metadata">

**Author:** ![joris](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/joris/32/338_2.png) [@joris](https://discourse.cakephp.org/u/joris)\
**Post date:** [May 24, 2017, 5:29pm UTC](https://discourse.cakephp.org/t/check-application-rules-without-saving/2605/4 "2017-05-24T17:29:00Z")

</div>

I suggest you use transactions. This way you can check each save, if one fails, everything gets rolled back. When everything succeeds all saves are committed.  
[https://book.cakephp.org/3.0/en/orm/saving-data.html#converting-multiple-records](https://book.cakephp.org/3.0/en/orm/saving-data.html#converting-multiple-records)

---

<div class="post-metadata">

**Author:** ![wschwarte](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/wschwarte/32/31_2.png) [@wschwarte](https://discourse.cakephp.org/u/wschwarte)\
**Post date:** [May 27, 2017, 7:21pm UTC](https://discourse.cakephp.org/t/check-application-rules-without-saving/2605/5 "2017-05-27T19:21:54Z")

</div>

Patchentity maybe or otherwise in beforesave ?
