- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2024 09:05 AM - edited 03-18-2024 09:16 AM
Hi All,
I have requirement
1)company table (core_company) Default view.
2)contract table (ast_contract)
In ast_contract table there is field Vendor which is reference to core_company table.
My requirement is we should created new related list- contract in core_company table in default view . In that contract we should want to display contracts based on that company and contracts state is = Active/Expired one's only.
I'm expecting the contract related list at the highlighted place in the below snip. please let us know how to achieve this.
Thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2024 03:14 AM
@Sirri , as i can see there are 4 choice for state Draft, active, expired, cancelled so in the below i have removed expired and cancelled to show Draft and active ones only similarly if your requirement is different you can add encoded query or you can add current.addQuery .
(function refineQuery(current, parent) {
// Add your code here, such as current.addQuery(field, value);
current.addQuery('vendor.name',parent.name);
current.addQuery('state', "!=",'expired');
current.addQuery('state',"!=", "cancelled");
})(current, parent);
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2024 01:37 AM
@Sirri you can add one more query like
current.addQuery('active', true);
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2024 02:52 AM
Hi @swathisarang98 ,
please let me know as per my requirement how to mention in that state is active or expired in the script.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2024 03:14 AM
@Sirri , as i can see there are 4 choice for state Draft, active, expired, cancelled so in the below i have removed expired and cancelled to show Draft and active ones only similarly if your requirement is different you can add encoded query or you can add current.addQuery .
(function refineQuery(current, parent) {
// Add your code here, such as current.addQuery(field, value);
current.addQuery('vendor.name',parent.name);
current.addQuery('state', "!=",'expired');
current.addQuery('state',"!=", "cancelled");
})(current, parent);
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2024 06:15 AM