SAM: UI script" : CalculateTotalCost, how to use it in BR. Issues with total cost in list view.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2025 12:34 AM - edited ‎05-16-2025 12:49 AM
Hi Team,
Total cost is calculated using onLoad client script where we use "UI script" : CalculateTotalCost" to calculate total cost.
Further when we save the form , it is reflected in list view, before that in list view - total cost shows $0.00.
This is not correct behaviour- because until and unless onload client script executes , list view will always show total cost as $0.00.
Once the record gets inserted in alm_license table, it should automatically calculate total cost from the server side so that it will be reflected in the list view as well.
How to calculate total cost using after insert business rule so that once record is inserted in alm_license table it will automatically calculate total cost and it will be shown in list view also, we need not have to wait for onload client script to run and then we will save the form.
Basically , I want to mimic UI script "CalculateTotalCost" in business rule where total cost is calculated on the basis of unit cost , purchased rights , timespan [ start date , enddate , subscription]
Please help

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2025 01:25 AM
Are you seeing this issue in SAM workspace?
If yes, then this is known issue from ServiceNow and they confirmed that will be fixed in coming versions.
As an alternative workaround, use the entitlements table form view (alm_license) in the native UI instead of workspace.
Accept the solution and mark as helpful if it does, to benefit future readers.
Regards,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2025 01:30 AM
In the native Ui itself i am facing this issue in the list view of alm_license table. But in the form view of alm_license table it works fine because onload of the form the client script runs and it calculates value of total cost and set it to the cost field.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2025 01:38 AM
As per ServiceNow, they have this issue only with Software Asset Workspace.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1650157
If you see the same in form view, then i would suggest you to create a HI case with ServiceNow.
Regards,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2025 01:52 AM
Here once onLoad client script runs and value of the total cost gets saved in database , it is reflected properly in list view.
but before that list view shows $0.00
Incase if we are able to calculate total cost on alm_license table then please let me know the script of that BR