function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
nksfnksf 

IF, Case, And Condition Formula Field

Hi Guys,
Can you please help me out with this formula field.
IF Submission_Date__c <> NULL AND Record Type Name = "Account Number Issue" then show me Estimated_Completion_Date3__c
IF Submission_Date__c <> NULL AND Record Type Name = "New Order Assistance/Special" Terms then show me Estimated_Completion_Date3__c
IF Record Type is other than these 2 then and Submission_Date__c <> NULL it should show Estimated_Completion_Date1__c

I am trying this code below but it is not giving me the right Date. It is showing Estimated_Completion_Date1__c in all the Record Types

IF(AND(Submission_Date__c <> NULL, RecordType.Name = "Account Number Issue"), Estimated_Completion_Date3__c
IF(AND(Submission_Date__c <> NULL, RecordType.Name = "New Order Assistance/Special Terms"), Estimated_Completion_Date2__c, Estimated_Completion_Date1__c))

Thanks please help me it is very urgent
Best Answer chosen by nksf
PuneetsfdcPuneetsfdc
use isBlank instead of <>, try this

If( AND( (NOT(ISBLANK(Submission_Date__c))), (RecordType.DeveloperName = "Account_Number_Issue") ), Estimated_Completion_Date3_c__c ,

If( AND( (NOT(ISBLANK(Submission_Date__c))), (RecordType.DeveloperName = "New_Order_Assistance_Special_Terms") ), Estimated_Completion_Date2_c__c , Estimated_Completion_Date1_c__c )

)
and always use developer name instead of name

All Answers

PuneetsfdcPuneetsfdc
use isBlank instead of <>, try this

If( AND( (NOT(ISBLANK(Submission_Date__c))), (RecordType.DeveloperName = "Account_Number_Issue") ), Estimated_Completion_Date3_c__c ,

If( AND( (NOT(ISBLANK(Submission_Date__c))), (RecordType.DeveloperName = "New_Order_Assistance_Special_Terms") ), Estimated_Completion_Date2_c__c , Estimated_Completion_Date1_c__c )

)
and always use developer name instead of name
This was selected as the best answer
nksfnksf
Hi Puneet,
Thanks for your help it works. Can you also please help me out with this formula field. I want to use Submission_Date__c instead of CreatedDate. But when I replace CreatedDate with Submission_Date__c then I am getting this error message.
Error: Incorrect argument type for function 'DATEVALUE()'.

CASE( MOD( DATEVALUE( CreatedDate ) - DATE( 1900, 1, 7 ), 7 ), 
0, DATEVALUE( CreatedDate ) + 1 + 2, /* Sun: CreatedDate + 1 wknd day + 2 days */ 
4, DATEVALUE( CreatedDate ) + 2 + 2, /* Thurs: CreatedDate + 2 wknd days + 2 days */ 
5, DATEVALUE( CreatedDate ) + 2 + 2, /* Fri: CreatedDate + 2 wknd days + 2 days */ 
6, DATEVALUE( CreatedDate ) + 2 + 2, /* Sat: CreatedDate + 2 wknd days + 2 days */ 
DATEVALUE( CreatedDate ) + 2 /* Default (Mon/Tue/Wed): CreatedDate + 2 days */ 
)
nksfnksf
I got it thx Puneet