Clear the value of a field on a form if a relationship is deleted
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2023 12:14 AM
On the below form, I'm wanting to a create a business rule that removes the value of the Primary Application field if the there isn't a relationship for that selected Primary Application within the Business Applications tab:
The Business Applications tab automatically creates an entry between the markets request and a business application if the Primary Application field is populated. However, I'm now looking at a way for Primary Application field to be cleared out if the relationship is removed. I've written the following after business rule:
I was just wondering if somebody could advise what I need to do to empty the Primary Application field when the relationship between the markets request and the Primary Application field is deleted.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2023 12:26 AM
you need to create this Business rule on the m2m relationship table instead. If the relationship record is getting deleted the br should be before delete , if existing relationship records is greeting updated to new make new relationship then the br should be after update. Also you need to do make changes in the script to glide record the main table instead of the relationship table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2023 12:31 AM
What would the When to run conditions need to be?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2023 12:47 AM
@matthew_hughes You can use "before delete" when to run condition on relationship table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2023 01:09 AM - edited 12-15-2023 12:25 AM
Hi @SANDEEP28
I've tried the following code, but I can't get it to work: