+ Start a Discussion
TheLearnerTheLearner 

Very urgent---Throwing error in formula

HI Expers,

I wrote formula field , but it showong wrong output ,actually it need "to  ALLOWCONTAINS(UPPER(TEXT(Type__c)), 'WITH INJURY') AND Type__c<>'Member of Public (with Injury)'."

This is my formula: 


  ( 
!ISPICKVAL( Did_the_Injured_person_return_to_Work__c , '') || 
!ISBLANK( Date_IP_was_Fit_and_Able__c ) || 
!ISBLANK( Date_IP_Returned_to_Work__c ) 

&& 

!ISPICKVAL( Category__c , 'Lost Time') && 
!ISPICKVAL(Category__c,'Non-Lost Time') && 
!ISPICKVAL( Category__c , 'Medical Condition') && 
!ISPICKVAL(Category__c,'Non-Lost Time (Medical Treatment required)') && 
!ISPICKVAL( Category__c , 'Non-Lost Time (Restricted Work Case)') && 
NOT(CONTAINS(UPPER(TEXT(Type__c)), 'WITH INJURY')) && 
!ISPICKVAL(Type__c , 'Member of Public (with Injury)') 

)

could anyone help me please
 
Best Answer chosen by TheLearner
William TranWilliam Tran
Change this

NOT(CONTAINS(UPPER(TEXT(Type__c)), 'WITH INJURY')) && 
!ISPICKVAL(Type__c , 'Member of Public (with Injury)') 

to  this

CONTAINS(UPPER(TEXT(Type__c), 'WITH INJURY') && 
Text(Type__c) <> 'Member of Public (with Injury)'

As a common practice, if your question is answered, please choose 1 best answer. 
But you can give every answer a thumb up if that answer is helpful to you. 

Thanks

All Answers

Shashikant SharmaShashikant Sharma
AND( CONTAINS(UPPER(TEXT(Type__c)), 'WITH INJURY'),  NOT(ISPICKVAL(Type__c , 'Member of Public (with Injury)' ))

If you get error please share the error message.
TheLearnerTheLearner
HI Shashikant,

Thanks fore reply , there is two stauts are there that with injury and without injury, 

1.AND( CONTAINS(UPPER(TEXT(Type__c)), 'WITH INJURY'),

in this conditions only with injury values can saved,

 
2. NOT(ISPICKVAL(Type__c , 'Member of Public (with Injury)' ))

In this condition member of public(with injury) should not allow to save, but it should allow to save member of public(without injury)

here member of public(with injury) and member of public (witout injury) two picklist values of TYPE



 
TheLearnerTheLearner
HI,

ITs throwing missing ) syntax error,

if i keep and operator its allwing me save

AND( CONTAINS(UPPER(TEXT(Type__c)), 'WITH INJURY') && NOT(ISPICKVAL(Type__c , 'Member of Public (with Injury)' ))
William TranWilliam Tran
Change this

NOT(CONTAINS(UPPER(TEXT(Type__c)), 'WITH INJURY')) && 
!ISPICKVAL(Type__c , 'Member of Public (with Injury)') 

to  this

CONTAINS(UPPER(TEXT(Type__c), 'WITH INJURY') && 
Text(Type__c) <> 'Member of Public (with Injury)'

As a common practice, if your question is answered, please choose 1 best answer. 
But you can give every answer a thumb up if that answer is helpful to you. 

Thanks
This was selected as the best answer