When the change is submitted?

Emju
Member Posts: 11
Hello,
VarRecord.modify();
When the change is submitted?
a) a submit is implicitly called after the modify
b) when leaving the trigger
c) modify submit the transaction
Could you please explain these issues to me?
I found in online help: "When the system enters a C/AL codeunit, it automatically enables write transactions to be performed. When the system exits a C/AL code module, it automatically ends the write transaction by committing the updates made by the C/AL code."
I think that b) is the correct answer
Am I right?
VarRecord.modify();
When the change is submitted?
a) a submit is implicitly called after the modify
b) when leaving the trigger
c) modify submit the transaction
Could you please explain these issues to me?
I found in online help: "When the system enters a C/AL codeunit, it automatically enables write transactions to be performed. When the system exits a C/AL code module, it automatically ends the write transaction by committing the updates made by the C/AL code."
I think that b) is the correct answer
Am I right?
--
Tom
Tom
0
Comments
-
I'm almost sure I read somewhere that modify submitted the change.
I wrote a code in to try this.Customer.GET('45779977'); Customer.Name := 'New Name'; Customer.MODIFY; MESSAGE('New name is : %1', Customer.Name);
The MESSAGE was first displayed, and after that the error message came, telling I was not allowed to change the customer database. This supports your theory.
New code :Customer.GET('45779977'); Customer.Name := 'New Name'; Customer.MODIFY; Item.GET('1000'); MESSAGE('New name is : %1', Customer.Name);
With this example I first received the error message and not the other MESSAGE. So the modification will be submitted before the leaving the trigger or at least until next record command is being given. I changed the Item.GET command with Item.COUNT, and only the error message came. This supports my prevois theory.
B must be wrong. When you use modify I believe it is not an transaction, but a change. I would go for A.
I know if you use LOCKTABLE and not COMMIT, then the table is unlocked when it leaves the trigger.
BTW I have only worked with C/AL code and Navision for 2 1/2 month, som I'm not a pro, so maybee some seniors knows this better!0 -
Thank you for your information.
Colud you explain your answer to the question about transaction type?--
Tom0 -
I have copied this from the C/SIDE reference guide in TransactionType :
When you use Navision Database Server, it maps to Snapshot and when you use SQL Server, it maps to Browse.0 -
The passage C/SIDE Ref. Guide concerns a Report option that maps to one of the basic options but does not explain if it guarantees a consistent snapshot of the data read within the transaction.
However in the Transaction Type description in Snapshopt paragraph it is said that
This is a read-only transaction. Modifications cannot occur within the transaction. All read operations are performed with SERIALIZABLE locking. Therefore, share-locks are placed and are maintained until the end of the transaction. This guarantees a consistent snapshot of the data read within the transaction.
Therefore I think that the option should be set as Snapshot but not Browse.--
Tom0
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