Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

How to capture in a custom field the remaining time (SLA)

Posted on by Microsoft Employee

Hi there, 

I am working on Dynamics 365 (online) and I've been trying to capture in a custom field the remaining time (SLA) before failure on case form.

At the moment, timer Control displays how much time is remaining on a case but what I want to is to save the time (hours and minutes) onsave event. For example, if a case is paused because a user change the status of a case, I want to a have a field which stores the time (from the Time Control) left at that moment. The custom Field would be used in a View displaying how many hours left before failure instead of showing 'Paused' or Nearing Noncompliance, etc.

4666.sla.png

However, my attempts with JavaScript always return null.

Is there a way to do it with JavaScript or a plugin? Your advice or suggestions will be much appreciated.

Timer Control is on a Quick View Form.
My quick form name is : CaseSLAPKI
Entity Name : slakpiinstance
Attribute: Resolve_In

function CaptureSla()

{
if (Xrm.Page.getControl('CaseSLAPKI_CaseSLAPKI_slakpiinstance_Resolve_In') != null)
{
var manfCountyctrl = Xrm.Page.getControl('CaseSLAPKI_CaseSLAPKI_slakpiinstance_Resolve_In');
var country = manfCountyctrl.getAttribute().getValue();
alert(country);
}

}

*This post is locked for comments

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans