- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2025 01:34 PM
Thats a relatively good start at least its picking up the script.
On the sn_customerservice_case table try using the field name where the account team members are mentioned and use the below.
(function refineQuery(current, parent) {
current.addQuery(<"Account team members field">, parent.sys_id);
})(current, parent);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2025 01:48 PM - edited 01-19-2025 01:49 PM
There isn't a team members field on the Case table. When you create a team member, there is an Account field, where the user is added to. The example below, I'm adding Clark Kent as a Sales Representative to 'The Daily Planet' Account. If I go to the The Daily Planet Account record and look at the Account Team Members related list tab, I'll see this record. What I want to do, is create a relationship between the Case table and Account Team Members table, so if a Case is created against the Daily Planet, I want to see the Account Team members related list tab on the Case form, and see that Clark Kent is the Sales Representative for that Account. The like field between the Case table and Account Team Members tables, is the Account field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2025 02:03 PM
Hi @MStritt
Okay, in that case try this one...
(function refineQuery(current, parent) {
// Ensure the 'account' field from the parent case matches the 'account' field in the account team members table
current.addQuery("account", parent.account);
})(current, parent);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2025 02:14 PM
That did it. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2025 02:27 PM
You're welcome! Glad its sorted.