Forum Discussion

ChaseSterling's avatar
ChaseSterling
Qrew Member
3 years ago

Prevent direct self-reference?

In a table that has a self referencing relationship, is there a way to prevent the user from selecting the same record as the child?

e.g. in the classic User table example, where you can select a manager from the same user table, I would like to be able to prevent selecting yourself as your own manager.

It seems like 'dynamic form rules' would be perfect for this, as I could then display a message, and change the value to blank when this happens, but for some reason you can't select "record id#" as a field in the dynamic form rules. e.g. I'd like a dynamic rule that said "When Manager ID is equal to Record ID#, display a message"

------------------------------
Chase Sterling
------------------------------
  • I don't know why they block Record ID to be used in form rules.

    but, no problem.

    Make a new formula numeric field called [Record ID mirror] with a simple formula of [Record ID] and use it in the form rule.  You may need to put the field on the form to get it to work. 


    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------
    • ChaseSterling's avatar
      ChaseSterling
      Qrew Member
      Oh, good plan. Thanks for that!

      ------------------------------
      Chase Sterling
      ------------------------------
    • ChaseSterling's avatar
      ChaseSterling
      Qrew Member
      Works perfectly, thanks again!

      ------------------------------
      Chase Sterling
      ------------------------------