Home » Developer & Programmer » Forms » Master-Detail on same canvas v/s save method behaviour (Forms 6i)
Master-Detail on same canvas v/s save method behaviour [message #363037] Thu, 04 December 2008 22:07 Go to next message
Messages: 134
Registered: August 2007
Location: Mauritius
Senior Member
Hello again,
This post completes a question I asked some time ago. I have modelled a master-detail relation in a form to automate the listing of data coming from a single table. The Master part of the model is based on fields containing recurrent data, like department_id for example. Taking the employee table example, you actually have a number of repeating department_id for employees pertaining to the same department, right? Good. My detail block then is there to list out all employee records matching all the fields from my master block obviously.

In the detail block only, I have some fields for which nulls are not allowed at database level and whenever I do a creation of new record, fields from both master and detail blocks are meant to be considered as pertaining to the new record (completing each other as a single unit). This is where the whole problem comes from. When treating the save method, Form tries to commit both blocks (since both are database blocks) and fires a "Cannot insert null" exception in my master block for the required field(s) that only exist in the detail block.

Assumptions :
1] I do not wish to bypass the master-detail model since it comes so handy for the purpose of my form the way it works right now.

2] I have considered adding the required fields in the master block but I think it's quite incoherent of having cyclic relations between the master and detail blocks - thought of having the not-null fields copying their values from detail block on new records.

3] I fear that solution in 2 might result in Form inserting 2 records.

4] I thought also of placing all required fields in master block and shown next to detail block fields and have detail blocks counterparts copying their values from them (without being shown on the canvas). The same problem of double records might crop up.

That's it. Suggestions are most welcome.

best regards,

Re: Master-Detail on same canvas v/s save method behaviour [message #364323 is a reply to message #363037] Mon, 08 December 2008 00:33 Go to previous message
Messages: 10180
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Use two tables.

Previous Topic: Picture not saved
Next Topic: can key-commit re-check the input value?
Goto Forum:

Current Time: Mon Aug 21 14:23:44 CDT 2017

Total time taken to generate the page: 0.03185 seconds