Skip to main content
for better understanding
Source Link
user29935
  • 763
  • 9
  • 24
  • 50

I have a formula field which don't have syntax errors. The characters in this formula has not even more than 500 characters. But, it is showing 2,535 characters. I need this formula as much as possible in very less characters and the formula is given below.

DATETIMEVALUE (DATE(

  YEAR(Dup__cDATEVALUE( Exact_Date__c )) + FLOOR( ( MONTH (Dup__cDATEVALUE( Exact_Date__c )) + 2 - 1 ) / 12 ),

  MOD( MONTH (Dup__cDATEVALUE( Exact_Date__c )) + 2 - 1 + 
    IF( DAY (Dup__cDATEVALUE( Exact_Date__c )) > CASE( MOD( MONTH (Dup__cDATEVALUE( Exact_Date__c )) + 2 - 1, 12 ) + 1, 

      2, 2928,

      4, 30,

      6, 30,

      9, 30, 

      11, 30,

      31 ), 1, 0 ), 12 ) + 1,

    IF( DAY (Dup__cDATEVALUE( Exact_Date__c )) > CASE( MOD( MONTH (Dup__cDATEVALUE( Exact_Date__c )) + 2 - 1, 12 ) + 1,

      2, 2928, 

      4, 30, 

      6, 30, 

      9, 30, 

      11, 30, 

      31 ), 

    1, DAY (Dup__cDATEVALUE( Exact_Date__c ))

   )
  )
)

Where Exact_Date__c is a Date-Time filed which works as input field takes date and time from object.

Specifically, why i need this requirement, i am using this formula field in another formula field which results in character error more than 5000.

I tried with breaking the formula field into multiple fields as in reference 1 is saying, but giving same result in characters.

I followed through following references. But its returning same result.

These are the reference 1 and reference 2

could any one help me how i can reduce the formula characters?

I have a formula field which don't have syntax errors. The characters in this formula has not even more than 500 characters. But, it is showing 2,535 characters. I need this formula as much as possible in very less characters and the formula is given below.

DATETIMEVALUE (DATE(

  YEAR(Dup__c) + FLOOR( ( MONTH (Dup__c) + 2 - 1 ) / 12 ),

  MOD( MONTH (Dup__c) + 2 - 1 + 
    IF( DAY (Dup__c) > CASE( MOD( MONTH (Dup__c) + 2 - 1, 12 ) + 1, 

      2, 29,

      4, 30,

      6, 30,

      9, 30, 

      11, 30,

      31 ), 1, 0 ), 12 ) + 1,

    IF( DAY (Dup__c) > CASE( MOD( MONTH (Dup__c) + 2 - 1, 12 ) + 1,

      2, 29, 

      4, 30, 

      6, 30, 

      9, 30, 

      11, 30, 

      31 ), 

    1, DAY (Dup__c)

   )
  )
)

Specifically, why i need this requirement, i am using this formula field in another formula field which results in character error more than 5000.

I tried with breaking the formula field into multiple fields as in reference 1 is saying, but giving same result in characters.

I followed through following references. But its returning same result.

These are the reference 1 and reference 2

could any one help me how i can reduce the formula characters?

I have a formula field which don't have syntax errors. The characters in this formula has not even more than 500 characters. But, it is showing 2,535 characters. I need this formula as much as possible in very less characters and the formula is given below.

DATETIMEVALUE (DATE(

  YEAR(DATEVALUE( Exact_Date__c )) + FLOOR( ( MONTH (DATEVALUE( Exact_Date__c )) + 2 - 1 ) / 12 ),

  MOD( MONTH (DATEVALUE( Exact_Date__c )) + 2 - 1 + 
    IF( DAY (DATEVALUE( Exact_Date__c )) > CASE( MOD( MONTH (DATEVALUE( Exact_Date__c )) + 2 - 1, 12 ) + 1, 

      2, 28,

      4, 30,

      6, 30,

      9, 30, 

      11, 30,

      31 ), 1, 0 ), 12 ) + 1,

    IF( DAY(DATEVALUE( Exact_Date__c )) > CASE( MOD( MONTH (DATEVALUE( Exact_Date__c )) + 2 - 1, 12 ) + 1,

      2, 28, 

      4, 30, 

      6, 30, 

      9, 30, 

      11, 30, 

      31 ), 

    1, DAY(DATEVALUE( Exact_Date__c ))

   )
  )
)

Where Exact_Date__c is a Date-Time filed which works as input field takes date and time from object.

Specifically, why i need this requirement, i am using this formula field in another formula field which results in character error more than 5000.

I tried with breaking the formula field into multiple fields as in reference 1 is saying, but giving same result in characters.

I followed through following references. But its returning same result.

These are the reference 1 and reference 2

could any one help me how i can reduce the formula characters?

for better understanding
Source Link
user29935
  • 763
  • 9
  • 24
  • 50

I have a formula field which don't have syntax errors. The characters in this formula has not even more than 500 characters. But, it is showing 2,535 characters. I need this formula as much as possible in very less characters and the formula is given below.

DATETIMEVALUE (DATE(

  YEAR(Dup__c) + FLOOR( ( MONTH (Dup__c) + 2 - 1 ) / 12 ),

  MOD( MONTH (Dup__c) + 2 - 1 + 
    IF( DAY (Dup__c) > CASE( MOD( MONTH (Dup__c) + 2 - 1, 12 ) + 1, 

      2, 29,

      4, 30,

      6, 30,

      9, 30, 

      11, 30,

      31 ), 1, 0 ), 12 ) + 1,

    IF( DAY (Dup__c) > CASE( MOD( MONTH (Dup__c) + 2 - 1, 12 ) + 1,

      2, 29, 

      4, 30, 

      6, 30, 

      9, 30, 

      11, 30, 

      31 ), 

    1, DAY (Dup__c)

   )
  )
)

Specifically, why i need this requirement, i am using this formula field in another formula field which results in character error more than 5000.

I tried with breaking the formula field into multiple fields as in reference 1 is saying, but giving same result in characters.

I followed through following references. But its returning same result.

These are the reference 1 and reference 2

could any one help me how i can reduce the formula characters?

I have a formula field which don't have syntax errors. The characters in this formula has not even more than 500 characters. But, it is showing 2,535 characters. I need this formula as much as possible in very less characters and the formula is given below.

DATETIMEVALUE (DATE(

  YEAR(Dup__c) + FLOOR( ( MONTH (Dup__c) + 2 - 1 ) / 12 ),

  MOD( MONTH (Dup__c) + 2 - 1 + 
    IF( DAY (Dup__c) > CASE( MOD( MONTH (Dup__c) + 2 - 1, 12 ) + 1, 

      2, 29,

      4, 30,

      6, 30,

      9, 30, 

      11, 30,

      31 ), 1, 0 ), 12 ) + 1,

    IF( DAY (Dup__c) > CASE( MOD( MONTH (Dup__c) + 2 - 1, 12 ) + 1,

      2, 29, 

      4, 30, 

      6, 30, 

      9, 30, 

      11, 30, 

      31 ), 

    1, DAY (Dup__c)

   )
  )
)

I followed through following references. But its returning same result.

These are the reference 1 and reference 2

could any one help me how i can reduce the formula characters?

I have a formula field which don't have syntax errors. The characters in this formula has not even more than 500 characters. But, it is showing 2,535 characters. I need this formula as much as possible in very less characters and the formula is given below.

DATETIMEVALUE (DATE(

  YEAR(Dup__c) + FLOOR( ( MONTH (Dup__c) + 2 - 1 ) / 12 ),

  MOD( MONTH (Dup__c) + 2 - 1 + 
    IF( DAY (Dup__c) > CASE( MOD( MONTH (Dup__c) + 2 - 1, 12 ) + 1, 

      2, 29,

      4, 30,

      6, 30,

      9, 30, 

      11, 30,

      31 ), 1, 0 ), 12 ) + 1,

    IF( DAY (Dup__c) > CASE( MOD( MONTH (Dup__c) + 2 - 1, 12 ) + 1,

      2, 29, 

      4, 30, 

      6, 30, 

      9, 30, 

      11, 30, 

      31 ), 

    1, DAY (Dup__c)

   )
  )
)

Specifically, why i need this requirement, i am using this formula field in another formula field which results in character error more than 5000.

I tried with breaking the formula field into multiple fields as in reference 1 is saying, but giving same result in characters.

I followed through following references. But its returning same result.

These are the reference 1 and reference 2

could any one help me how i can reduce the formula characters?

Source Link
user29935
  • 763
  • 9
  • 24
  • 50

How to reduce charcters in formula field

I have a formula field which don't have syntax errors. The characters in this formula has not even more than 500 characters. But, it is showing 2,535 characters. I need this formula as much as possible in very less characters and the formula is given below.

DATETIMEVALUE (DATE(

  YEAR(Dup__c) + FLOOR( ( MONTH (Dup__c) + 2 - 1 ) / 12 ),

  MOD( MONTH (Dup__c) + 2 - 1 + 
    IF( DAY (Dup__c) > CASE( MOD( MONTH (Dup__c) + 2 - 1, 12 ) + 1, 

      2, 29,

      4, 30,

      6, 30,

      9, 30, 

      11, 30,

      31 ), 1, 0 ), 12 ) + 1,

    IF( DAY (Dup__c) > CASE( MOD( MONTH (Dup__c) + 2 - 1, 12 ) + 1,

      2, 29, 

      4, 30, 

      6, 30, 

      9, 30, 

      11, 30, 

      31 ), 

    1, DAY (Dup__c)

   )
  )
)

I followed through following references. But its returning same result.

These are the reference 1 and reference 2

could any one help me how i can reduce the formula characters?