You need to sign in to do that
Don't have an account?
virat ms kohli
Regarding date validation rule
Hi,
We have 2 objects named seller and invoice. Let's make a month into 2 parts as 1 to 15 and 16 to 31. The seller and invoice have a lookup relationship. If we entering data on the seller object from date 1 to 15 then the invoice date must only be before 1 to 15 that is before month 16 to 31. It should not enter future dates. Or else if we entering data on the seller object from date 16 to 31 then the invoice date must be before 16 to 31 which is the same month 1 to 15. That is a condition so kindly help me in developing validation rule for this. As I was new to salesforce kindly help by writing validation rule for me.
Thanks and Regards,
Virat
We have 2 objects named seller and invoice. Let's make a month into 2 parts as 1 to 15 and 16 to 31. The seller and invoice have a lookup relationship. If we entering data on the seller object from date 1 to 15 then the invoice date must only be before 1 to 15 that is before month 16 to 31. It should not enter future dates. Or else if we entering data on the seller object from date 16 to 31 then the invoice date must be before 16 to 31 which is the same month 1 to 15. That is a condition so kindly help me in developing validation rule for this. As I was new to salesforce kindly help by writing validation rule for me.
Thanks and Regards,
Virat
IF(AND (Day(Seller__c.Date_Seller__c) <16, Day( Date_Invoice__c ) >15), TRUE, IF(AND (Day(Seller__c.Date_Seller__c) >15, Day( Date_Invoice__c ) <16), TRUE, FALSE))
If you want to check month and year also, you can add that condition in outer IF
IF(YEAR(Date_Invoice__c)<> YEAR(Seller.Date_Seller__c),TRUE,IF(MONTH(Seller.Date_Seller__c)<> MONTH(Date_Invoice__c ),TRUE,IF(AND (Day(Seller.Date_Seller__c) <16, Day( Date_Invoice__c ) >15), TRUE, IF(AND (Day(Seller.Date_Seller__c) >15, Day( Date_Invoice__c ) <16), TRUE, FALSE))))
Replace "Seller" with your object Seller field api name on invoice object
and replace "Date_Seller__c" with Seller object's date field
and replace "Date_Invoice__c " with Invoice object's date field