Render Model Rows Based on Values of Rows in Another Model

  • 1
  • Question
  • Updated 12 months ago
  • Answered
I'm trying to create a drawer in a table (Model A) that drops down records in Model B ONLY if the records in Model B have a Date AFTER the record in Model A.

The scenario is: I have a Table (Model A) with a date field associated with each record. I want to create a Drawer that shows records from Model B, ONLY IF the Date of each record on Model B are after the Date of the record in Model A. 

Is this possible to do without any coding/Javascript?

Thank you!
Photo of Ben Knecht

Ben Knecht

  • 946 Points 500 badge 2x thumb

Posted 12 months ago

  • 1
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Use the context option for the table in the drawer.
Photo of Ben Knecht

Ben Knecht

  • 946 Points 500 badge 2x thumb
Hey Pat,

I tried that out, but the Operator only gives me options of Equal or Not Equal to. I need a "Greater than or Equal" to option. Any ideas?
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Yup. Forgot about that UI restriction. Context is simply a component specific condition. You can create the condition on the model and the copy/paste into the place where this context/condition is in XML.
Photo of Ben Knecht

Ben Knecht

  • 946 Points 500 badge 2x thumb
Ahh, I see. I'll give that a go but not sure I'm competent enough to do it haha. Do you think a subquery on the model would work?
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
No. It needs to be contextual to the row in which you clicked the row action. Must be hacked in.
Photo of Ben Knecht

Ben Knecht

  • 946 Points 500 badge 2x thumb
Thanks Pat, I appreciate the help. I'll try to hack it through.