- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2022 07:05 AM
Could someone please let me know if there's a way to remove the new button from related list based on a Form's Field Value?
Referring the image above (also attached with this post), I need the new button on the related list to be made in-accessible once the "Status" field on the form is updated to "Completed" choice.
The related list (Tasks) only shows records associated with a particular form.
I noticed that omit New button can be used in list control but I can't seem to pass the field value from the form to the condition script.
Is there a way to access the "Status" field value from the form and pass it into the Omit new Button Script condition?
Or is there any other way to make the New Button unavailable after that Field value change?
Thank you in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2022 10:18 PM
parent is your form object.
if (parent.status == <value>)
true; // Show the New button
else
false;
Please update the value of status and try.
For your reference:-
Thanks & Regards,
Vasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2022 07:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2022 08:29 AM
Hello @Vasantharajan N ,
I appreciate the response!
I've mentioned in the description, I already tried this but I don't know how to access the field values from the form to be used in the if condition since the filed is on another table/form.
If it's not too much to ask, Could you please provide the code for the condition?
Thank you so much in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2022 09:49 PM
Could you please provide the form table name and the filter on the related list (Which filter is applied to task table )
Thanks & Regards,
Vasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2022 10:04 PM
Hello
The form table name is "x_dasf_status_reports", the table field name to be referred from the form is "status" and the filter applied to the related list is actually a relationship script:
(function refineQuery(current, parent) {
current.addQuery('id', parent.sys_id);
})(current, parent);
parent is "x_dasf_status_reports" and current is "Tasks" table.
There is a field in tasks table called "id" which stores the sys_id of particular status reports so that each task can be mapped to a status report.
The id field is automatically populated when a NEW task is created from the Status Report Related List.
Thank you so much in advance!