Table insert in Application

lisachew

Active Member
Dear All,

First question:
Currently, I've create a Header detail Form for the user to add data to table. Using business view from the table F554111 that I've created. In the OK button event rules, I put ...

Example:=
Button Clicked:
Insert.F554111

But I always get the result errors such as duplicate keys not allowed as shown in attachment. No matter how many record I tried to add in it will always display the error, and the highlighted area will always be a line before the empty line. But funnily, the data are actually captured in the table. To my opinion, would it be possible that it has errors because of the blank line, as the line is also capture into the table with zero amount.

Second question:
I was wondering whether can I actually put the 2 insert.Fxxx function in the Application? Pls refer to the example given below.

In the OK button event rules, I put ...

Example:=
Button Clicked:
Insert.F554111
Insert.F554111A

**I did tried to put both insert table in the Post Button Clicked**

(If this method can be used, then you may proceed to read the next question. But if not, just ignore the next question.)

When I clicked on the OK button, all the data are insert into the F554111. But only one line or mayb none at all was inserted to the other table F554111A. Let me refresh you, I am using the table F554111 as the business view only. Would it be possible that it was not inserted to the F554111A table because it was not the business view?

Please help as I have been stuck to this problem for days. And I have not enough efficient reference to help.

Thank you very much.





Best regards;
Lisa
OneWorld XE B733.3
SP 13
Intel NT4-service pack 6A
SQL 7
Service Pack 2
 

Attachments

  • 3-25199-MultiLevel.doc
    56 KB · Views: 89
To assist you further, maybe you can have a look at the event rules to have a better understanding.

Thanks again

Best regards;
Lisa
OneWorld XE B733.3
SP 13
Intel NT4-service pack 6A
SQL 7
Service Pack 2
 

Attachments

  • 3-25200-sumaary.txt
    7.3 KB · Views: 84
Lisa

Have you disabled the automatic database updates on the Options check boxes for the Header & Grid? If you haven't and you're performing Table I/O manually via the OK Button then you may get duplicates.

Hope this helps

Jamie



XE SP15 AS/400 V4R4. NT Deployment Server.
 
Hi Lisa,

Generally Add, Update and Delete functions are standard behaviours of Header Detail type forms, so there is no need to accomplish this with ER, if only you have a special logic.

Have you disabled this automatic behaviours on the Option section on the Properties panel of the Grid and Form or with the Suppress system functions in ER (e.g. issuing "Suppress Add" call in the "Add Record to DB - Before event") at all?

Here are some possible conflict which could cause your problem:

1.) Your Table I/O insert statement conflicts with the automatic insert.
2.) The Business Views for the Header an Detail part based on the same Table.
3.) You issue the Insert in Update Mode (not in Add Mode).
4.) Your Business View(s) is(are) based on more joined table not on a single table.

May I advise you to check the "Understanding Form Types" (under Application Design / Form Design) and "Process Flow for Header Detail Form" (under Appendix B.) in the Development Tools Manual of the Documentation CD?

Please, let us know about your progress. Thanks.

Regards,

Zoltán

B7332 SP11, ESU 4116422, Intel NT4, SQL 7 SP1
(working with B7321, B7331, XE too)
 
Back
Top