Add second condition to Insert Record Behaviour
I have an ‘Insert record behaviour’ that is triggered by a ‘form submit’. I would like to add a second condition so it only triggers if both conditions are met. I have constructed an ‘Access Rule’ that I would like to use as the second condition.
The ‘Access Rule’ uses a ‘Record Set’ on the page which basically constructs the following:
Allow If <?php echo($rsConsLeaseholders->getColumnVal("total_flats")); ?> <= 10
( see attached screen shot for settings )
So I want the insert to fail if ’total_flats’ is 10 or less.
I have tried to adjust the insert behaviour ‘if statement’ as follows:
From this - if (isset($_POST["submit-consent-sb"]) || isset($_POST["submit-consent-sb_x"])) {
To this - if (isset($_POST["submit-consent-sb"]) || isset($_POST["submit-consent-sb_x"]) && (WA_Auth_RulePasses("10orLess"))) {
But with the adjustment the ‘Insert Behaviour’ is still being triggered when the ’total_flats’ value is more than 10.
Where am I going wrong here?
Page attached..
Thanks in advance!