function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rakshana Cube84Rakshana Cube84 

how to check the createdDatetime of a case is before 30mins of now?

Hi
I need to check whether t case which is created before 30mins of now.
Best Answer chosen by Rakshana Cube84
atul patil 7atul patil 7
Hello Rakshana ,
-we can achive this by creating on custom field of type check box (set its default value as a'true') and write one workflow to uncheck the checkbox after 30 min of created date and time and call the the field update action to update field value
-when case is created this checkbox is checked by default that means this case created before less than 30 min
-after 30 min workflow will fired and update the Field : set checkbox to uncheck that means this case created before greater than 30 min
steps:-
1.create one custom field which have type:checkbox 
-bydefault set its value true 
2.Go to on Edit Layout of case add add this field on Highlights Panel so it can be displayed on case Highlights Panel 
-go to setting button on Highlights Panel and add it
3.Create one workflow Rule on case object
-set rule creiteria to formula evaluate true
-add this formula:
        VALUE(TEXT( 
        FLOOR(ClosedDate - CreatedDate) 
        ) & " Days " & 
        TEXT( 
        ROUND(MOD((ClosedDate - CreatedDate)*24,24),0) 
        ) &" Hours " & 
        TEXT( 
        ROUND(MOD((ClosedDate - CreatedDate)*1440,60),0) 
        ) &" Minutes ") > 30
        
4.Click on next button you will jump on step 3 where you can set workflow action
-click on add workflowaction dropdown and select : New Field Update
-Give unique name and select the field which we have already created i.e. checkbox field
-set Checkbox Options to false and save it.
-click on done button and activate the workflow

mark this is as best answer if you find this helpful
thanx,
atul patil
salesforce developer
www.zen4orce.com