Make related list visible/hide
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 08:07 AM
i have a requirement to hide/show an employee related list on Company table in few scenarios,those are..
if user create New record in employee table it should be in Draft state--- Hide Employee related list.
if user submit the record-- moved to submit state --- Show record 2
if user click on reset to draft --- moved into Draft -- in this case we have to shown Employee Related list.
finally
if new record created in company table-- if record is in Draft -- Hide employee related list.
if company record is moved to draft and it is in draft state then show Employee related list,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 08:11 AM
Hi @VSN ,
Plz add these code in ur condition whenever it satisfies. Use on load script for the same.
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 08:11 AM
Hi @VSN,
You can create a onchange client script and use showRelatedList() and hideRelatedList() to show and hide related list based on conditions.
Example Script :
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
var brkGlass = g_form.getValue('u_break_glass'); //Assuming u_break_glass is the exact column value
if(brkGlass == 'yes'){ //Replace yes with the exact choice value of the field breadk glass
g_form.showRelatedList("BreakGlassRequests"); //Make sure you pass the name of the related list
}else{
g_form.hideRelatedList("BreakGlassRequests"); //Make sure you pass the name of the related list
}
}
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....