Delete entry after insert

bRahmsbRahms Member Posts: 44
edited 2010-03-04 in Navision Attain
Hi,

I have an issue i've been wondering about quite some time now. It's like that:

I have a table filled in with several records: for example : (v = true)
Linenr  Waybillnr   Boolean     Status     Status date    Status time 
1          1000                          2        23-02-2010       08:12:29
2          1100                          2        23-02-2010       08:16:14
3          1000           v             5        24-02-2010       12:10:04
When I have my form based on this table, i have for the detail of Waybillnr 1000:
Status Date Status Time Status
23-02-2010 08:12:29 2
24-02-2010 12:10:04 5

Now the thing is, when the boolean has been set to TRUE, the user may not add any other status. He adds a status date, a timestamp and then he adds a statuscode.
When I add a error message on the OnValidate() of the Status field (or even on the OnInsert), he gives me the error message, but the record is allready been made with the datetime. Is there any possibility that i delete the record after the onvalidate of the status?

Comments

  • BeliasBelias Member Posts: 2,998
    try to use delayedinsert property, and put the error in the oninsert trigger (of the table)...you can also use testfield function instead of a defined "ERROR" function, in order to not have to manage the text constant multilangage... :wink:

    TESTFIELD("boolean field");
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • bRahmsbRahms Member Posts: 44
    Thank you, that did the trick :)
Sign In or Register to comment.