I am stuck. In my form I have a master block (blockA), a detail block (blockB) and a third block (blockC) that is linked to blockB via a standard relation on blockB where blockB.id = blockC.id. In blockB if column adtype = 'P' then the requirement is that a corresponding record is entered into blockC. So If I enter several detail records into blockB and set adtype = 'P' on each then I can double click on each and add the details to blockC. Save. This works fine and when I re-query each of the records can be seen as appropriate. The problem I'm facing is enforcing a record to be entered into blockC based on the adtype equaling 'P' in blockB. I have tried performing checks in lots of different triggers but to no avail the same thing keeps happening which is this. If I create more than one record in blockB with an adtype of 'P' but don't enter any details into blockC my checks will always flag this up when saving. If however I enter some details into blockC for the first of the records from blockB with an adtype of 'P' then all checks are passed and no errors are raised. It is as if that now a record exists in blockC I can no longer check for the existence of a record even though that record is only applicable to the first record in blockB and not any of the others??
I hope I have explained this clearly enough for someone to come to my aide as I am truly stumped!
Many Thanks in advance
I think I understand your situation (a bit difficult to follow indeed) but the problem might be here:
> If I create more than one record in blockB
With a master-detail, you have to save the master and detail data before continuing to another master record. So, you cannot enter several records in blockB and several records in blockC at the same time.
I wonder, did you never get a "do you want to save the changes" message when going from one record in blockB to the next?
Thank you very much for taking the time to respond. Yes you are correct I do get the 'do you want to save changes' message when going from one record in blockB to another if I am entering details in blockC.....I am incorrectly using a master-detail relationship when I must need to approach this programmatically although I am not sure how?
I don't know if creating blocks based on procedures would circumvent the "do you want to save...". I never tried it, but I don't think so. Maybe someone with experience in that area can give an answer.
In your case I would do a POST before moving to another record. A POST sends the data to the database, but without a commit. You can still rollback the changes if needed.
So doing a POST allows for moving between the records ok without getting the "do you want to save...." message, however the original problem still exists in that I am unable to check for an existence of a record in blockC once I have saved the first record ie the form will let me exit without ensuring there is a corresponding record in blockC for EVERY record in blockB where the adtype = 'P'?