Create form depending on record(s) in other table
Create form depending on record(s) in other table
Hello,
I want to check, when a user wants to create a new record in a table, if in another table there is minimal 1 record. When there are no records in the other table, I want to display a message so that the user first needs to create a record in that other table.
This because in the new to creating record, there should be a relation to the other table.
So also I want to check when a user wants to delete the record from the other table, that this is prohibited because it is used in the other table with the relation.
How should I do this?
Thank you in advance.
Noël
This question has an accepted answers - jump to answer
Answers
Sounds like an ideal case for a custom button. You would have the button's action function first check to see if the condition is satisfied or not - if not then show the error message. If it is then call the
create()
method to show the create form.Allan
Thanks for the direction. After some puzzling and looking at the examples it worked out for me.