Release/commit a table programatically
arindam
Member Posts: 176
Hi All,
I have 2 cases,
1) I have assigned a variable for say sales header table as recSalesHead in a form.
2) In another form Sales Header table is assigned to the form's source table.
Now I am updating the table in case 1 -
..
..
..
Insert;
Commit;
For case 2 what should i use to commit the updation to the table. Presently I am using -
..
..
..
recSalesHead.Insert;
recSalesHead.reset;
I am using case 1 in a function of a code unit. After performing this task when I am trying to update Sales Header table (in case 2) at my form, it is giving an error -
"Another user has modified the record for this Sales Header after you retrieved it from the database.
Enter your changes again in the updated window, or start the interrupted activity again.
Identification feilds and values:
Document Type='Order',No.='1009' "
Please advice.
Thanks
Arindam
I have 2 cases,
1) I have assigned a variable for say sales header table as recSalesHead in a form.
2) In another form Sales Header table is assigned to the form's source table.
Now I am updating the table in case 1 -
..
..
..
Insert;
Commit;
For case 2 what should i use to commit the updation to the table. Presently I am using -
..
..
..
recSalesHead.Insert;
recSalesHead.reset;
I am using case 1 in a function of a code unit. After performing this task when I am trying to update Sales Header table (in case 2) at my form, it is giving an error -
"Another user has modified the record for this Sales Header after you retrieved it from the database.
Enter your changes again in the updated window, or start the interrupted activity again.
Identification feilds and values:
Document Type='Order',No.='1009' "
Please advice.
Thanks
Arindam
0
Comments
-
I am not sure if your description is clear enough to understand your problem... but if you are modifying same record from two points in code, why you are using INSERT in second case when the record was already inserted in first case?0
-
Hi Arindam,
If I understand you correctly - to commit the second case is just to you issue the commit statement i.e. the insert function is record (table) specific but commit is for the database. What is throwing you off is that if you issue the insert command on it's only it is assuming the Rec record (Sales Header in your case).
Look up the two functions in the C/Side Reference Guide for more info.
Hope this helps0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
