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
SforcehariSforcehari 

Critical Validation Rule

Hai to salesforce,

 

  I have Destinationoperator field on the object,MessageRoutingType and Message Type are picklistfields on the Masterobject.

 

 Requirement:-

 

          On insert  ,Destinationoperator is not Blank,

 

          on Update, When  Destinationoperator has changed ,Validate that the MessageRoutingType  and  Message Type on Master are

 

         must populated.

 

Regards,

Haribabu Amudalapalli

Best Answer chosen by Admin (Salesforce Developers) 
goabhigogoabhigo

Correct me if I am wrong, if Destinationoperator is filled MessageRoutingType  and  MessageType should be filled.

Try this :

! ISNEW() && ! ISBLANK(Destinationoperator__c) && ISBLANK(TEXT(MasterObject__r.MessageRoutingType__c)) && ISBLANK(TEXT(MasterObject__r.MessageType__c))

 

This will validate on update, if the Destinationoperator is not blank then MessageRoutingType and MessageType of the MasterObject should be filled.

All Answers

goabhigogoabhigo

Correct me if I am wrong, if Destinationoperator is filled MessageRoutingType  and  MessageType should be filled.

Try this :

! ISNEW() && ! ISBLANK(Destinationoperator__c) && ISBLANK(TEXT(MasterObject__r.MessageRoutingType__c)) && ISBLANK(TEXT(MasterObject__r.MessageType__c))

 

This will validate on update, if the Destinationoperator is not blank then MessageRoutingType and MessageType of the MasterObject should be filled.

This was selected as the best answer
SforcehariSforcehari

Hai abhi,

 

 Thank for your help,BUt i am getting small issue like,

 

        Whhile inserting DESTINATION Operator is ALSO NOT Blank.

 

 But with out Value in Destination Operator, Record is saving

 

please help me!

 

Regards,

Haribabu

goabhigogoabhigo

Its not clear. Can you explain bit more? Do you want error message to be displayed if DestinationOperator is not filled, while inserting also?

SforcehariSforcehari

Yes!your right. How we can

goabhigogoabhigo

Then create one more validation rule - ISNEW() && ISBLANK(Destinationoperator__c).

 

This will show error message while creating the record for the 1st time, if the Destinationoperator__c is blank.