A moment ago I just finished wiring up the exact same thing and Cancel works without adding a record. My Add and Cancel buttons on the subform do nothing but an unconfigured TransferData, they're just placeholders for the Form to hook into.
I noticed that your rule looks at the subform is closing event, that's going to happen for Save and Cancel. In my version which I copied from K2 Expense Claim Application Accelerator I modify the Add and Cancel events, not the closing events. In the Cancel event on the form I simply close the subview and nothing is added.
If you're stuck download the Application Accelerators and look at them.
Dear ,
Since ur Rules (Add new row , transfer , apply) are on subview closing , they will be applied either u Save or Cancel ,
I suggest u remove the rules from that event , and actually disable that event ,
and Modify/Configure ur "Save button" and "Cancel Button" on the Form Level , which means ,
Go to ur form , Add event when a control on subview is clicked ,
when "Save button is clicked " use the same rules u r using above inside the "subview is closing"
when "cancel button is clicked"
-Close subview only ,
In this way , ur data will only be transfer when u click on "save" button ,
Hope it helps,
Regards.
Thank you both for your replies.
AhmadYaqub, your posting might work too, but I have such a large form that I'm trying to do everything I can on a View level as there is so much that has to be done on the main Form level. Therefore, I tried the View solution first and it worked.
NigelS, I made the changes you suggested and they worked. I had to change the Subview rules to unconfitured transfer data instead of close subview, change the View Cancel button rule to close the subview, change the View Add button rule to include all of the actions I had previously under the subview is closing rule, and deleted the subview is closing rule).
Thank you,
tschaef