Skip to main content The Trailblazer Community will be unavailable from 2/1/2025 to 2/2/2025. Please plan your activities accordingly.
help me to write trigger if date is less than or equal to 10 , i need to upate previous month last date . if it is above 10 we need to update same day

ex: date : 04-Jun-17   output -- 31-may-17

ex: date  : 10-jun-17  output -- 31-may-17

ex: date   11-jun-17    output -- 11-jun-17
5 answers
  1. Jun 26, 2017, 6:18 PM
    Date__c (Field user enter date as 08-06-17  )

    Copy__C(Output need to be 31-05-17)

    I have tried with formual field also :

    IF(MONTH(Date__c) < 12,

    IF(DAY(Date__c) > 10, Date__c, DATE(YEAR(Date__c), MONTH(Date__c)-1,30)),

    IF(DAY(Date__c) > 10, Date__c, DATE(YEAR(Date__c) + 1, 1, 30)))

    but iam getting output as 01-05-17   i need to be 31-05-17

     
Loading
0/9000