Creating a Cancel Button

I like to include “Cancel” buttons on data-entry web pages. These are similar to Mats’ “Back” buttons, but I can put ‘em where I want them and leave them out where they aren’t needed.

I especially like them on pages where a record is automatically created on entry. For these pages, the Cancel button fires a Rule to delete the empty record (context record for the page) before returning to the previous page.

This is easy and works well where the “return-to” page has no base object.

My problem is that I want to return to a page that does have a base object that has a parent-child relationship to the record I want to delete. Deleting the child record is simple, but when I do, I lose the relationship to the parent. When I return to it there is no context record and the page is blank.

So, any advice on a way to do this that will work and let me return to the parent page with its context record intact?

Thanks,

Randy

Hi There,

My name is Mark and I am a Platform Solutions Developer here at MatsSoft and I’m here to help you. I will take a look at your issue and reply back in due course.

Regards - Mark

1 Like

Hi Randy,
We’ve done similar where we were removing a relationship and returning to the parent page. I’m not sure it’s the best way, but it works for us.

You can have the Cancel button trigger an event-rule combination to mark child as cancelled. The rule sets a boolean property on the child record 'Mark for cancel = yes".

Then return-to the parent page as the relationship is still intact.

The parent page has an ‘event on page load’ which triggers a rule for deleting any child records that meet the constraint “related to parent with ‘Mark for cancel = yes’”.

All the best
Craig

3 Likes

Thanks for picking this one up. Great to see Community Members helping each other!
Cheers, Tony

Craig,

Thanks. It’s not exactly elegant, but it will work!

Regards,

Randy