Insertion through codeunit.

sabzam
Member Posts: 1,149
When inserting a record through codeunit is it possible to automatically run the coding behind. For example in a sales header once the sell-to customer no is entered it is automatically retrieved the address along with vat no. and other info. Can this be achieved even when inserting through codeunit?
0
Comments
-
To Run the code that is run when manually inserting code use:
Rec.INSERT(TRUE); --- instead of --- Rec.INSERT;
And
VALIDATE(Rec.Field, 'NewValue'); --- instead of --- Rec.Field := 'NewValue';0 -
Hi,
Thanks for your prompt reply. I will test it out and let you know whether it works properly.
Good evening.0 -
Hi Everybody,
I have got an issue with an insertion through validate. I am trying to use validate on a locatiop code in the Sales Header and it is not working. I am assuming that this is because it prompts a message which the user is to confirm. Is it possible to skip this step and force an insertion?0 -
If there is a confirmation dialog box generated by the validation code then it should trigger as normal. Could you post your code?0
-
Hi,
Please don't go for the force insertion through the code in the location code. But use the validate as suggested. If possible use the debugger to see if the code that you have writtent is triggering or not.Diptish Naskar
For any queries you can also visit my blog site: http://msnavarena.blogspot.com/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
- 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