Using data templates to modify records

Dekito
Member Posts: 19
Hi everyone,
Here is the issue:
I'm trying to apply a data template (through coding) to a customer record.
Here's part of the code:
I get the following error/notification:
This only appears when I use the Template Management Codeunit, if I statically apply the currently entered fields in the template, to the Customer record, everything is OK.
ANY SUGGESTIONS?
Thanks in advance
Here is the issue:
I'm trying to apply a data template (through coding) to a customer record.
Here's part of the code:
RecRef.GETTABLE(Customer); TemplateManagement.UpdateRecord(DataTemplateHeader,RecRef);I get the Data Template Header from a setup table, and the 'Customer' variable is already filled with a customer record.
I get the following error/notification:
but I'm sure that no one has modified it.Another User has modified the record for this Customer after you retrieved it from the database.
Enter your changes again in the updated window, or start your activity again.
This only appears when I use the Template Management Codeunit, if I statically apply the currently entered fields in the template, to the Customer record, everything is OK.
ANY SUGGESTIONS?
Thanks in advance
Dekito
0
Answers
-
Problem solved:
I added Customer.FIND('='); //get the rec. again
before my code:
RecRef.GETTABLE(Customer);
TemplateManagement.UpdateRecord(DataTemplateHeader,RecRef);
and it works ](*,)Dekito0
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