• Salvatore Esposito
  • NEWBIE
  • 5 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 4
    Replies
1) There is a multiselect picklist field 'BU_Specialty_Name__c' with values "A","B","C" & "R". The condition is that, If user selects any value along with "R", an error should occur saying that 'R should be selected alone'. For this I have implemented a Validation rule as below: 
IF(OR(AND(INCLUDES(BU_Specialty_Name__c,"R"),INCLUDES( BU_Specialty_Name__c,"A")),
      AND(INCLUDES(BU_Specialty_Name__c,"R"),INCLUDES( BU_Specialty_Name__c,"B")),
      AND(INCLUDES(BU_Specialty_Name__c,"R"),INCLUDES( BU_Specialty_Name__c,"C"))
      ),
  true, false)
It is working fine for the environment(Sandbox) which has "A","B","C"&"R" values for 'BU_Specialty_Name__c'.
2) But now, the requirment is that, For the other environment(Prod),  'BU_Specialty_Name__c' has few more values "A","B","C","D", "E" & "R". 
    Here also same condition should be given that is, If user selects any value along with "R", an error should occur.
   And we cannot overwrite Validation rule depending upon environment always.

  So,Is there any alternative to throw an error When user selects any value along with "R", instead of calling all the values as I did above?
 The idea should work for all environments independant on other multiselect picklist values.

Any kind of suggestion is accepted. Thanks in advance!
This is what I have so far.  Everything is working fine except the AM and PM is only returning "AM" on every conversion. Also don't know how to solve for AM and PM when the time changes between PST and PDT. 

CASE( MOD( DATEVALUE(Event_Date_Start_Time__c) - DATE(1900, 1, 7), 7), 0, "Sunday", 1, "Monday", 2, "Tuesday", 3, "Wednesday", 4, "Thursday", 5, "Friday", 6, "Saturday","Error")
+", "+

CASE(MONTH(DATEVALUE( Event_Date_Start_Time__c )), 
1,"January", 
2,"February", 
3,"March", 
4,"April", 
5,"May", 
6,"June", 
7,"July", 
8,"August", 
9,"September", 
10,"October", 
11,"November",
12,"December",
NULL) 

+ ' ' + 
TEXT(DAY(DATEVALUE(Event_Date_Start_Time__c ))) 
+ ', ' + 
TEXT(YEAR(DATEVALUE(Event_Date_Start_Time__c )))
+ '  ' +

/*Daylight Savings*/
if( 
((Datevalue(Event_Date_Start_Time__c ) >= Date(2016,3,13)) && (Datevalue(Event_Date_Start_Time__c ) <= DATE(2016,11,6))) || 
((Datevalue(Event_Date_Start_Time__c ) >= Date(2017,3,12)) && (Datevalue(Event_Date_Start_Time__c ) <= DATE(2017,11,5))) || 
((Datevalue(Event_Date_Start_Time__c ) >= Date(2018,3,11)) && (Datevalue(Event_Date_Start_Time__c ) <= DATE(2018,11,4))) 
,

/*Append 24 HR GMT TO 12 hr PDT (GMT-7)(Daylight Savings Time)*/
TEXT(CASE(VALUE(MID(TEXT( Event_Date_Start_Time__c ), 12, 2)), 
24,5, 23,4, 22,3, 21,2, 20,1, 19,12, 18,11, 17,10, 16,9, 15,8, 14,7, 13,6, 12,5, 11,4, 10,3, 9,2, 8,1, 7,12, 6,11, 5,10, 4,9, 3,8, 2,7, 1,6, NULL))
,

/*Append 24 HR GMT TO 12 hr PST (GMT-8)*/
TEXT(CASE(VALUE(MID(TEXT( Event_Date_Start_Time__c ), 12, 2)), 
24,4, 23,3, 22,2, 21,1, 20,12, 19,11, 18,10, 17,9, 16,8, 15,7, 14,6, 13,5, 12,4, 11,3, 10,2, 9,1, 8,12, 7,11, 6,10, 5,9, 4,8, 3,7, 2,6, 1,5,NULL))

+
/*Append the minutes*/
mid(text(Event_Date_Start_Time__c ),14,3)+ " "+ 

/*Adds AM/PM */ 
if((value(mid(text(Event_Date_Start_Time__c ),12,2))<7 )&& (value(mid(text(Event_Date_Start_Time__c ),12,2))>=19)," PM", " AM")

 
  I'm trying to calculate the future date when the contract ends. I have 2 custom fields:

Service Effective Date which is a picklist showing 1, 2 and 3 years respectivelyand Contract Activation Date which contains date when contract started and activated.
If only one year then End date of contract year should be 12 months from Service_Effective_Date__c
If two years then End date of contract year should be 24 months from Service_Effective_Date__c
If three years then End date of contract year should be 36 months from Service_Effective_Date__c
Hello All,
I have completed this challenge.

1-For this first you need to create a helper formula field(type-percent) 
Percent Completed :
(DATEVALUE( CreatedDate ) - CloseDate )/100


2- Then you need to create the actual formula field (type- text) by using the helper formula field.
Opportunity Progress :

IF( Percent_Completed__c <=25,"Early", 
IF(Percent_Completed__c <=75,"Middle", 
"Late"))

Thanks,
Nida