Hello,

I try to do the following in my bizobj code, only for new records: 

Field A can be 0 or 1. If it is 0, the data should be saved as entered (this 
works). If it is 1, then the value for field D should be calculated from the 
values in B and C. This doesn't work.

If I put the code for checking field A and doing the necessary calculations 
into onNew() or afterNew(), then it is executed before anything is entered in 
the form. So field A has still its default value 0.

If I put it into onSaveNew(), then something curious happens: when I press 
the "Save" button I get a message box with the question "Do you wish to save 
your changes?" and when I press "Yes", then I get this error message:

Save Failed:

columns artikel, ausg_datum, firma are not unique
SQL: insert into "ausgaben" 
("aufschlag", "firma", "orig_betrag", "ausland", "abrech_datum", "ausg_datum", 
"artikel", "bemerk", "waehrung", "kauf_typ", "euro_betrag", "kurs") values 
(3.322960944517748389342800287, 'IB Phoenix', 132.54, 1, 
NULL, '2008-10-05', 'Firebird CD', '', NULL, 'I', 
189.8834825438713365338743021, 0.698007)  

This looks as if the method tries to insert the same record twice. I did check 
in the database table: there was no other record with the same values before 
I created the new one, but afterwards it is there, only without the 
calculated values. In the error message those values are there (the 
fields "euro_betrag" and "aufschlag").

What happens here?
Sibylle

-- 
Dr. Sibylle Koczian


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]

Reply via email to