Confirm dialog

hhhhhhhqat
Member Posts: 111
you know any modify in navision is saved after modify direct ,
i have one form , we need more control for any change, i add onmodify trigger this code
IF CONFIRM('Do you confirm?',TRUE) THEN
MESSAGE('saved')
ELSE
ERROR('not saved');
EXIT;
but still even i din't confirmed and close this form it's already saved
what's the mistake i did or may be i forget something
i have one form , we need more control for any change, i add onmodify trigger this code
IF CONFIRM('Do you confirm?',TRUE) THEN
MESSAGE('saved')
ELSE
ERROR('not saved');
EXIT;
but still even i din't confirmed and close this form it's already saved
what's the mistake i did or may be i forget something
0
Comments
-
Is the code on the OnModifyRecord() trigger of the form or on the record?
Also, is any code executed (maybe with a commit?) before reaching your code?
Try to debug your code step by step to see what exactly happens.0 -
it's onmodify trigger of the form , i just add this to give the user message to save or exit without same for any modify
thanks0 -
It should work... It works on my test Database... :-k
Try the following:
IF CONFIRM('Do you confirm?',TRUE) THEN
MESSAGE('saved')
ELSE
begin
MESSAGE('not saved');
EXIT(FALSE);
end;0 -
it's working fine now , but for some record like global dimension 1 & 2
still no control0 -
hhhhhhhqat wrote:it's working fine now , but for some record like global dimension 1 & 2
still no control
Can you explain this more?0 -
example in Employee Card i ahve Cost center (Global Dimension 1) , if i try to modify and later ignore this change it will save even i not confirmed , but other records like name , Job Title ,etc..... is OK
should i add also in Dimension table
thansk0 -
Here's a post by Kriki that we use to confirm a change and if not return the orig value.kriki wrote:I think it is best you put it in the OnValidate-trigger of the table and not the form. Of course this means it will ALWAYS be triggered. I don't know if this is the idea.
The code:IF (rec."The Field" <> xRec."The Field) and (CurrField = FIELDID("The Field")) THEN // this checks if the field is changed by the user and not by some other means IF NOT CONFIRM('Do you want to change the value from "%1" to "%2" in field "%3"?',false, rec."The Field",xRec."The Field,FIELDCAPTION("The Field")) THEN ERROR(''); // just raises an error but without message
Of course it is best to use a constant instead of writing the text directly into the CONFIRM like I did.
orig post here:
viewtopic.php?f=23&t=351090
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions