I am new to Salesforce and I am trying to implement the below scenario.

I am having Custom object Timer__c and is having fields User__c to User and a Time field Time__c. Once I enter time in Time__c, lets say 10 seconds and on clicking save, record should get saved and the countdown timer should get started at same time and at the end of 10 seconds, I want to show the popup in service console. Can anyone help me in implementing the same if possible.

  • are you using Classic or lightning? – Sagar Hinsu Oct 17 '18 at 10:01

I think you don't have to use Apex for this. You can directly create a lightning component and use javascript setTimeOut or setInterval to your advantagge.

There is a sample lightning component for timer: Examples for Lightning Timer Component

More about javascript setTimeout : https://www.w3schools.com/js/js_timing.asp

  • Hello Pranay, actually my requirement is pretty different here, on clicking save button the record should get saved and also automatically timer should start in the background and at the end of timer, a pop up should come. I am not going to work on any buttons rite. – user61203 Oct 17 '18 at 10:07
  • 1
    You have to create records using Apex or lightning data services, but that timer or modal etc has to be javascript. Apex is server side and the UI you want cant be done single handedly with Apex – Pranay Jaiswal Oct 17 '18 at 10:11
  • If possible, can you help me out with code please. – user61203 Oct 17 '18 at 10:29
  • 2
    This forum is not a code writing service. Please refrain from asking others to provide code samples. Thanks – glls Oct 17 '18 at 12:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy