• Vanaja MadiReddy
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 4
    Replies
Hi Team,

I've two Objects Object1 & Object2

Each Object have one Picklist:
Object1>Picklist1
Object2>Picklist2

I want to display value selected in Picklist1 should automatically display in Picklist2.

Ofcourse we can try Flow, But

I want to achieve it by writing Formula under 
Setup>Object manager>Object2>Fields & Relationships> Picklist2> Gebneral Options> Default Value > Formula Editor.

any one have any idea on how to write formula for it?
Hi,
ROUND( 8.5 * ABS(( 5 * FLOOR( ( DATEVALUE( Now() ) - DATE( 1900, 01, 08) ) / 7) +
MIN(5,MOD( DATEVALUE( Now() ) - DATE( 1900, 01, 08), 7) +
MIN( 1, 24 / 8.5 * ( MOD( DATETIMEVALUE(Now() )- DATETIMEVALUE( '1900-01-08 08:30:00' ), 1 ) ) )))
-
( 5 * FLOOR( ( DATEVALUE( CreatedDate ) - DATE( 1900, 01, 08) ) / 7) +
MIN( 5,MOD( DATEVALUE( CreatedDate ) - DATE( 1900,01, 08), 7 ) +
MIN( 1, 24 / 8.5 * ( MOD( DATETIMEVALUE(CreatedDate) - DATETIMEVALUE( '1900-01-08 08:30:00' ), 1) ) )))),3 )


The above formula returns difference between Now() and CreatedDate in minutes format for Case record. (Example : 0.01 , 0.50, 1.01)
It works fine when Case is created during business hour(8:30 AM to 5:00PM) and business days(Mon-Fri).
But for Cases created during non-business hour or non-business day,  it returns a random value and decreases minute by minute when the business hour starts .
Expected behaviour is that formula should return 0.00 and increase minute by minute from the start of business hour.

Any idea would be helpful.