Hi all,
I am looking for a method of preventing a record being created in a Child table if there is no corresponding Parent record.
This is an app for developing a Job Hazard Analysis document for construction projects. The parent table is "Project" the child to that is "Tasks" and the child to that is "Hazard". I want to prevent any records from being created in either "Tasks" or "Hazard" if there is no "Project" (project.project_id) existing first.
Thank you for any help!
Ray
Prevent Orphan Records
Re: Prevent Orphan Records
Did you check the [X] Required flag on all lookup fields?
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: Prevent Orphan Records
For some reason, whenever I check the parent_id field as required, AppGini unchecks them. Is there some reason that these fields cannot be marked as Required?
Re: Prevent Orphan Records
Lookups can definitely be required. I'm doing so almost every day.
Did you change any other properties of the lookup field like datatype?
Just adding a field CTRL+F and setting the 2 most important lookup settings (table+caption) without touching any other properties does just fine. Then you should be able to check [X] Required flag.
I have never experienced problems with required lookup fields.
Did you change any other properties of the lookup field like datatype?
Just adding a field CTRL+F and setting the 2 most important lookup settings (table+caption) without touching any other properties does just fine. Then you should be able to check [X] Required flag.
I have never experienced problems with required lookup fields.
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: Prevent Orphan Records
I have left the data types as defined by AppGIni: Integer, Unsigned, But I have them set to hide and some are auto fill.
Re: Prevent Orphan Records
It's odd, I check the "Required" box for one of the parent fields and if I click on another field and then back to the parent field it is unchecked. If I check the "required" box and generate the app the requirement does not take place in the app and the box is then unchecked.
Re: Prevent Orphan Records
I am so dumb sometimes!! I read through the documentation online and found that if a lookup field is marked as "Read Only" the "Required" parameter will be ignored. Sorry to create a useless post!