• sfbatch
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies
Hi Guys can anyone please help(explain) me the following formula. As I have very basic knowledge, it is hard to me understand the formula. We are using this formula in case management system. Here FLAGS__ViewedFlag__c is Date/Time field(object type). Please explain me how it works.

Thanks in advance.
RPAD(
RPAD(
RPAD(
text(CASE(VALUE(TRIM(LEFT(TRIM(RIGHT(TEXT(FLAGS__ViewedFlag__c),9)),2))),
13,13,
12,13,
11,13,
10,13,
9,13,
8,13,
7,13,
6,13,
5,22,
4,22,
3,22,
2,22,
1,22,
0,22,
24,22,
23,22,
VALUE(TRIM(LEFT(TRIM(RIGHT(TEXT(FLAGS__ViewedFlag__c),9)),2)))))
,3,":"),
5,
IF(VALUE(TRIM(LEFT(TRIM(RIGHT(TEXT(FLAGS__ViewedFlag__c),9)),2)))>=22,
'00',
IF(VALUE(TRIM(LEFT(TRIM(RIGHT(TEXT(FLAGS__ViewedFlag__c),9)),2)))<13,
'00',
TRIM(RIGHT(TRIM(LEFT(TEXT(FLAGS__ViewedFlag__c),16)),2))))),8,
':00')))
Guys Will you please explain me the following Validation rule, as I have very basic knowledge on date validation rules I am unable to understand the following date validation rule.  Currently we are stuck in this validation rule in cases, which are clearing basing on priority. We are giving support to our customers basing on priority, the following is our old priority and issue clearance for our customers and we have to apply new priority rules to serve our customers. 

IF(
ISNULL( FLAGS__ViewedFlag__c),
null,
DATETIMEVALUE(TEXT(
DATEVALUE(FLAGS__ViewedFlag__c+
CASE(TEXT(Priority),
'P1',
CASE(MOD(DATEVALUE(FLAGS__ViewedFlag__c)- DATE(1900, 1, 7),7),
1,1,
6,3,
0,2,
2,1,
3,1,
4,1,
3),
'P2',
CASE(MOD(DATEVALUE(FLAGS__ViewedFlag__c)- DATE(1900, 1, 7),7),

1,2,
6,4,
0,3,
2,2,
3,2,
4),
'P3',
CASE(MOD(DATEVALUE(FLAGS__ViewedFlag__c)- DATE(1900, 1, 7),7),
1,3,
6,5,
4,5,
5,5,
0,4,
2,3,
3,5,
5),
CASE(MOD(DATEVALUE(FLAGS__ViewedFlag__c)- DATE(1900, 1, 7),7),
6,9,
0,10,
7))))
Hi Guys can anyone please help(explain) me the following formula. As I have very basic knowledge, it is hard to me understand the formula. We are using this formula in case management system. Here FLAGS__ViewedFlag__c is Date/Time field(object type). Please explain me how it works.

Thanks in advance.
RPAD(
RPAD(
RPAD(
text(CASE(VALUE(TRIM(LEFT(TRIM(RIGHT(TEXT(FLAGS__ViewedFlag__c),9)),2))),
13,13,
12,13,
11,13,
10,13,
9,13,
8,13,
7,13,
6,13,
5,22,
4,22,
3,22,
2,22,
1,22,
0,22,
24,22,
23,22,
VALUE(TRIM(LEFT(TRIM(RIGHT(TEXT(FLAGS__ViewedFlag__c),9)),2)))))
,3,":"),
5,
IF(VALUE(TRIM(LEFT(TRIM(RIGHT(TEXT(FLAGS__ViewedFlag__c),9)),2)))>=22,
'00',
IF(VALUE(TRIM(LEFT(TRIM(RIGHT(TEXT(FLAGS__ViewedFlag__c),9)),2)))<13,
'00',
TRIM(RIGHT(TRIM(LEFT(TEXT(FLAGS__ViewedFlag__c),16)),2))))),8,
':00')))