Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form trigger to re-populate form

Status
Not open for further replies.

bookouri

IS-IT--Management
Feb 23, 2000
1,464
US
Ive got a "Personnel" form with multiple tab pages. The first tab page is basic employee information, the next couple fo tab pages are "tabular" and designed to hold addresses, phone numbers, contacts etc. These tabular tab pages tables are linked to the person table by person_id that is generated with a basic before-each-row trigger on the person table. If I add a new person, Save that record, then re-query the database for that person, I can go to the address, phone, etc tab pages and add those bits of information. However, if I just add the new person, save that record, and go on to the other tab pages, the address, phone etc. data is not saved. Apparently I need some kind of post-save-record-requery trigger. Can anybody point me in the right direction. I dont want the user to have to manually re-query the new employee.

thanks for any suggestions
 
If you just add a new employee, there is no address & phone data to be saved.

How do you have your relationships between your Employee block and the various children blcoks set? It should be coordination not deferred and auto-query checked.

[sup]Beware of false knowledge; it is more dangerous than ignorance.[/sup][sup] ~George Bernard Shaw[/sup]
Consultant Developer/Analyst Oracle, Forms, Reports & PL/SQL (Windows)
My website: Emu Products Plus
 
yep, when they add a new employee they have all the current address and phone stuff available, they just have to re-query the record after they save the main record in order to add the addresses and stuff. I think the "coordination not deferred and auto-query" stuff might be taking me in the right direction

 
Why is it necessary to save & requery a new employee? When the coordination is correct, inserting a new Employee row will clear all children blocks making them available for entry. As long as the children blocks are secondary to the Employee block and the children get their sequence number from the employee (which should be assigned at pre-insert), there should be no need to save and requery.

[sup]Beware of false knowledge; it is more dangerous than ignorance.[/sup][sup] ~George Bernard Shaw[/sup]
Consultant Developer/Analyst Oracle, Forms, Reports & PL/SQL (Windows)
My website: Emu Products Plus
 
Well, i thought the coordination would just magically work too, but it doesnt. The child blocks do get their sequence numbers from the employee. I also took a look at the coordination and auto-query properties on the relationships and they seem to be set right. Inserting a new employee row does clear all the children blocks however.

any other ideas would be appreciated...
 
Are your child blocks database blocks?

Are there any pre-insert triggers on those child blocks that might be preventing the insert action?

Are the child blocks sequenced after the Employee? That is to say, in the navigator pane, does the employee table appear above the children?

...person_id that is generated with a basic before-each-row trigger
Did you change this to be done on the pre-insert?

[sup]Beware of false knowledge; it is more dangerous than ignorance.[/sup][sup] ~George Bernard Shaw[/sup]
Consultant Developer/Analyst Oracle, Forms, Reports & PL/SQL (Windows)
My website: Emu Products Plus
 
yes, the child blocks are database blocks
no, there are no active pre-insert triggers on the child blocks
yes, in the navigator pane, the employee data block is first, followed in the navigator by the child blocks
no, i havnt changed the before-each-row trigger to a pre-insert... Ill try that...


 
Oops, the first T was a typo (uppercased T from Set :)), should be DML_RETURNING_VALUE. Note, that it should be set in design mode.

Regards, Dima
 
Thanks Dima, the dml_returning_value did the trick.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top