Display different child form Based on Multiple choice

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered

I have a table (variation) which is linked to another table (variation items).  As I need to open different variation form item depending on the value on the parent form,  is there a way, I could achieve this?  I have two forms created in the child table.  

Photo of Arshad Khwaja

Arshad Khwaja

  • 3,152 Points 3k badge 2x thumb

Posted 3 years ago

  • 0
  • 1
Photo of Blake Harrison - DataBlender

Blake Harrison - DataBlender, Champion

  • 100 Points 100 badge 2x thumb
Within the "Add Child" formula URL, you can set an IF statement to determine the form needed during the Add process, similar to this:

URLRoot() & "db/" & [_DBID_CHILD] & "?a=API_GenAddRecordForm&_fid_21=" & URLEncode ([Record ID#])&

"dfid=" & IF([Criteria Field] = 1, 2,10) &

 "&z=" & Rurl()

In the section in bold above, DFID is the parameter that identifies the Form the user will be shown. In the IF statement, I've just used an example, but the 2 and 10 are the Form ID's found in the table.
Photo of Arshad Khwaja

Arshad Khwaja

  • 3,152 Points 3k badge 2x thumb
Thanks a lot. The primary criteria to decide as what form to be opened resides in the variation (parent table). The criteria you have indicated, is this from parent?

Could there be a similar approach to edit or view child record or in other words how do I see different forms when scrolling records depending on what the criteria is.
Photo of Blake Harrison - DataBlender

Blake Harrison - DataBlender, Champion

  • 100 Points 100 badge 2x thumb
It's really more of a complex problem than you would think as you really need to consider the business case and the business logic behind the decision to have 2 forms in the first place, rather than utilizing form rules. If you'd like to reach out to me directly, we can discuss it further.