How to calculate the count from the related list?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2018 03:09 AM
Hi All,
How to get the number present in the related list into a particular string field?
What I mean is "(say) for example, we are having the total count (number) of the related list as '10', that value should be copied to the String field".
Please do let me know how to achieve it.
Any Ideas?
Thanks & Regards,
Ram Prakash
- Labels:
-
Enterprise Asset Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2018 06:11 AM
Can you share a screen shot of this List.
Thank you,
Ashutosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2018 03:36 AM
Hi Ram,
It's simple. Go and check the System Definition -> Relationships record and condition, Then use the service side script.
System Definition -> Relationships
Check condition like
current.addQuery('caller_id', parent.caller_id);
User the GlideAggregate object to get the count
var count =new GlideAggregate('incident');
count.addAggregate('COUNT');
count.query();var incidents =0;if(count.next())
incidents = count.getAggregate('COUNT');
Hit Correct/ Endorsers/ Helpful/ Like depending on the impact of the response
@Lakshmaiah Dumpala
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2018 04:33 AM
Hi Lakshmaiah,
I couldn't find the relationship which i require in the "System Definition -> Relationships" Table.
What might be the next workaround?
Thanks & Regards,
Ram Prakash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2018 07:52 PM
Hi Ram,
Still we have option way we check the condition the related list table.
Open related list -> Go filter icon -> Right click on filtered record condition -> Using Copy query : You will get the condition
-> Using Copy URL : You will get the both table name and query condition to table.
Ex:-
Copy URL :: https://yourinstance-now.com/clm_m2m_contract_asset_list.do?sysparm_query=contract%3D83be799c9770300000f8d7b8fa297500%5E
Copy query (Condition) :: contract=83be799c9770300000f8d7b8fa297500
For more detailed visualization to you check attached screen.
Hit Correct/ Endorsers/ Helpful/ Like depending on the impact of the response
Lakshmaiah Dumpala
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2018 08:05 PM
Hi Ram,
Still if you have issues keep posting the question in community.
Thanks,
Lakshmaiah Dumpala