• Michael French 61
  • 0 Points
  • Member since 2017

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
  • 0
We have an SObject MyObject__c with a custom validation rule that says either FieldA__c or FieldB__c must be filled in, otherwise throw an error.

We want this to be reflected on custom lightning forms that we create for inserting or updating MyObject__cs. For example, if we have a form for inserting a MyObject__c, we want to be able to disable the save button until either FieldA__c or FieldB__c is filled in. We plan to add more fields with similar validation rules, so we would like to be able to do this dynamically.

Is there a way we can reference the validation rule either in Lightning or in Apex to dynamically mark that certain fields must be filled in when others arent? Or is the best way to just hard-code it in whatever lightning component we create?