DELETEALL bug ?
Eugene
Member Posts: 309
in a form i do the following call:
LRec.SetMyGlobalVariable(TRUE);
LRec.DELETEALL(TRUE);
here LRec is a recordset
in the underlying table i have the following:
1) globaly defined boolean variable
bMyGlobalVariable
2) its access functions:
SetMyGlobalVariable(NewValue:Boolean);
begin
bMyGlobalVariable := NewValue
end;
GetMyGlobalVariable:Boolean;
begin
EXIT(bMyGlobalVariable);
end;
3) and the message in the OnDelete trigger of the table
MESSAGE(FORMAT(GetMyGlobalVariable))
what the problem is the message in the OnDelete trigger always returns FALSE
Is this a bug ?
Does the DELETEALL creates another copy of LRec to perform all the deletes:
LRec.SetMyGlobalVariable(TRUE);
LRec.DELETEALL(TRUE);
LRec.SetMyGlobalVariable(TRUE);
LRec.DELETEALL(TRUE);
here LRec is a recordset
in the underlying table i have the following:
1) globaly defined boolean variable
bMyGlobalVariable
2) its access functions:
SetMyGlobalVariable(NewValue:Boolean);
begin
bMyGlobalVariable := NewValue
end;
GetMyGlobalVariable:Boolean;
begin
EXIT(bMyGlobalVariable);
end;
3) and the message in the OnDelete trigger of the table
MESSAGE(FORMAT(GetMyGlobalVariable))
what the problem is the message in the OnDelete trigger always returns FALSE
Is this a bug ?
Does the DELETEALL creates another copy of LRec to perform all the deletes:
LRec.SetMyGlobalVariable(TRUE);
LRec.DELETEALL(TRUE);
0
Comments
-
I have not tested it but you might be right. I don;t know if it is a bug or if it is just supposed to work that way.
What is the reason you want this to work different than it does? It is an interessting subject.0 -
basically i have USERID and timestamp fields in the table to keep the track on who was the last to modify the record.
Then i don't want other users to be allowed to modify or delete the record (i check for this in onmodify and ondelete triggers)
But in one special case this rule should be overriden hence the reason for the global variable to let bypass the rule:LRec.SetMyIgnoreUserVar(TRUE); LRec.DELETEALL(TRUE); LRec.SetMyIgnoreUserVar(FALSE);
LRec.OnDelete trigger:IF NOT MyIgnoreUserVar THEN IF DifferentUser THEN ERROR('You are not allowed to delete the record') DoSomeOtherThings;0
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
- 322 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
