break, error, or what ?

Hi, i pretty new to navi so please be not to hard on me :wink: Ok, i want something like a “Do you really want to do this” window popping up when a user has changed something in a form. To do this i thought i place a statement like: “IF NOT form.runmodal(50011) = ACTION::OK THEN ???” in the OnModifyRecord trigger of main form. The problem is that navi say’s that i can not use the “NOT” in this case which I can accept. The real big problem is, that i have no clue of what to type instead of the ???. BREAK, HALT and QUIT are not working, while compiling navi always gives me an error and ERROR is also wrong as it always produces a new window and that would be uncool in this case. If anybody has a solution i’m eager to her it cu Tobias

Hi Tobias, Try something like IF NOT CONFIRM(‘Do you really want to change?’, TRUE) THEN Rec.COPY(xRec); in the OnModify-Trigger of the Record. IF the User doesn’t want to change all values in the record are restored. Look at CONFIRM in the Online-Help of Navision. Hope that will help you Frank

It worked thanx But I had changed “Rec.COPY(xRec)” to “Rec := xRec”

Form.Runmodal doesn’t return a boolean value, so NOT Form.RUNMODAL will be a bad sentence for Navision. CONFIRM should be the best option in most cases… but You can also do as you tried if you need to show a personalized form (as it can be a form with the customer status) by using some code hints… Instead of IF NOT FORM.RUNMODAL(50111) = ACTION::OK THEN try this IF (FORM.RUNMODAL(50111) = ACTION::OK) THEN BEGIN ; END ELSE BEGIN Yourcode; END; or this one IF (Form.RUNMODAL(50111) <>ACTION::OK) THEN or this one… IF (NOT (Form.RUNMODAL(50111)=ACTION::OK))THEN … Regards, Alfonso Pertierra Spain

Hi Tobias, if you want to work with a Form, it is also possible to say IF FORM.RUNMODAL(50011)=Action::Cancel THEN … if the PushAction-Property of the Cancel-Button is ‘Cancel’ You can use this also with other values of the PushAction-Property! Greetings Frank

thx guy’s you really helped me alot finaly i switched to the solution apertierra sugested cause it give me the oportunity to ask the user why he changed the record. thx tobias