Conditionallly render a field by comparing its value to another field?

  • 1
  • Question
  • Updated 1 year ago
  • Answered
I can't figure this one out.

How can I create a rendering condition on Field1__c that checks the value of Field1__c against the value of Field2__c and renders (or doesn't) based on the result?

(easy peasy if conditional rendering snippets had context)
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb

Posted 1 year ago

  • 1
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Wouldn't a snippet for this work great? If only context was available. miright?
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
Could you do a Ui only field that compares the value of the two fields then base the rendering of Field1__c on the value of the UI only field?
(Edited)
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Yup! Good call.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Raymond,

That's what I ended up doing... only I had to do it ~30 times for 30 different fields.

Thank God for Sublime Text 3!
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
Glad you had a solution. I'm going to check out Sublime.