Getting wrong value for Business Duration field on RITM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2024 02:51 AM
Hi
Getting wrong value for Business Duration field on RITM below is my Business rule:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2024 03:03 AM - edited 11-11-2024 03:03 AM
Hello @raj99918 ,
Try below script
var opened = current.getValue('opened_at');
var closed = current.getValue('closed_at');
if (current.business_duration.nil())
current.business_duration = gs.calDateDiff(opened, closed, false); // Business Duration
Thanks,
Valmik Patil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2024 03:26 AM
Hi @Valmik Patil1 Still no luck please see this screeshot am getting the Business Duration as 0 seconds instaed of 3 minutues
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2024 08:26 PM
Hello @raj99918 ,
Can you try as below
var opened = current.opened_at.getDisplayValue();
var closed = current.closed_at.getDisplayValue();
if (current.business_duration.nil() || current.business_duration.getDisplayValue() == ''){
current.business_duration = gs.calDateDiff(opened, closed, false); // Business Duration
}
There could be issue that if condition is not getting satisfied.
Please log the value of if condition to check what exact value it displays
Thanks,
Valmik Patil