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
Synthia B.Synthia B. 

Validation Rule- Blank

When No is selected no date populates in the Executed Date field. When Yes is selected the Exeuted Date then populates with the latest date. My formula works fine when Yes is selected but does not work when no is selected. 
 
IF( Signed_By_Client__c >= Signed_by_Vendor__c , Signed_By_Client__c , Signed_by_Vendor__c )
User-added image


Signed by Client Date should have populated in Executed Date field as it is the only data available. 

User-added image

Thanks in advance!
Best Answer chosen by Synthia B.
Abhishek BansalAbhishek Bansal
Hi Synthia,

Please change your formula to the one mentioned below :
If(
	AND(
		NOT(IsBlank(Signed_By_Client__c)),
		Not(IsBlank(Signed_by_Vendor__c))
	),
	If(
		Signed_By_Client__c >= Signed_by_Vendor__c,
		Signed_By_Client__c,
		Signed_by_Vendor__c
	),
	If(
		IsBlank(Signed_By_Client__c),
		Signed_by_Vendor__c,
		Signed_By_Client__c
	)
)

Let me know if you have any issue with this.

Thanks,
Abhishek Bansal.

All Answers

James LoghryJames Loghry
What you posted above doesnt appear that it will work.  A validation rule is a true or false condition.  If the validation rule is true, then an error is displayed.  The formula you posted above compares two dates and returns a date (not a true or false condition).  You'll need to adjust your formula to return true or false depending on your criteria.
Abhishek BansalAbhishek Bansal
Hi Synthia,

You have not specified the condition in your formula field properly that is why it is always setting value in your date irrespective of Yes or No selected in field.
I have modified the formula accordingly as per your requirement.
Please find the formula below :
if(Vendor_Signature_Required__c == 'No',null,IF( Signed_By_Client__c >= Signed_by_Vendor__c , Signed_By_Client__c , Signed_by_Vendor__c )
)
//Please replace Vendor_Signature_Required__c with API name of your field on the basis of which you want to set //value in date field
Please let me know if you still have any issue with this or if you need more help on this.

Thanks,
Abhishek Bansal
 
Synthia B.Synthia B.
Hi Abhishek, 

I tried your formula and I am getting Error: Field Vendor_Signature_Required__c is a picklist field. Picklist fields are only supported in certain functions.  I am not sure how to correct this. 

Thanks for your help. 
Abhishek BansalAbhishek Bansal
Hi Synthia,

Please change your formula field as follows :
if(IsPickval(Vendor_Signature_Required__c,'No'),null,IF( Signed_By_Client__c >= Signed_by_Vendor__c , Signed_By_Client__c , Signed_by_Vendor__c )
)
Let me know if you have any further issues.

Thanks,
Abhishek Bansal.
Synthia B.Synthia B.
Hi Abhishek, 

There was no errors in the last formula however it is not picking up the date in the Signed by Client Field if Vendor Signature Required is No. 

User-added image


Thanks for your help.
Abhishek BansalAbhishek Bansal
Hi Synthia,

Can you please explain your requirement more clearly.
Please explain the following cases :
1. What should be Date when No is selected ?
2. What should be date when Yes is selected ?

If you clearly explain the scenarios than it would be easy to help you.
You can also contact me on my gmail or Skype :
Gmail : abhibansal2790@gmail.com
Skype : abhishek.bansal2790

Please let me know if i can help you in some other way.

Thanks,
Abhishek bansal.
Abhishek BansalAbhishek Bansal
Hi Synthia,

Please change your formula to the one mentioned below :
If(
	AND(
		NOT(IsBlank(Signed_By_Client__c)),
		Not(IsBlank(Signed_by_Vendor__c))
	),
	If(
		Signed_By_Client__c >= Signed_by_Vendor__c,
		Signed_By_Client__c,
		Signed_by_Vendor__c
	),
	If(
		IsBlank(Signed_By_Client__c),
		Signed_by_Vendor__c,
		Signed_By_Client__c
	)
)

Let me know if you have any issue with this.

Thanks,
Abhishek Bansal.
This was selected as the best answer