Apply Form View For New Records - Creating from related list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2025 10:43 AM
Hello Snow Buddies,
I'm writing this to share solution for one of tricky requirement I recently faced while working on project.
" Url is the Key to achieve applying view rule for new record "
Background: On Project record we have created new field called 'Manex' which is of type True/False. There is Manex view for Project record on this view we have configured Benefit plan related list (which references to benefit_plan table records). We have created several fields for Manex projects and Created 'Manex' view on Benefit Plan table.
Requirement: If any benefit plan related to Manex project should open in 'Manex' view.
Solution:
1. We created on view rule with condition Top Task.Manex is True and Applied a Manex View. This worked absolutely fine for existing record but when we click new button on Benefit Plan from related list new record opens in Default view and view rule was not working.
2. Then we Created New view for New Benefit plan record and write a script to apply Manex view for new benefit plan where parent is project and project is Manex.
The script as follows,
and this script fullfilled our requirement. Here it gets parent record table name, sys id of parent record so we can glide parent record and check if parent project is manex and apply Manex view.
Thanks..