writing to a field while opening a form

MsDeevy
Member Posts: 1
Hi,
I have a dilemma, but am sure this is something others also encountered. While opening a form, my code should look into another db to see if there is a value that needs updating. If so, the field in NAV will be updated.
1. I know this has performance issues but the custmer wants this to happen like this and a NAS service is out of the question sadly.
2. This is my first post, please be gentil :-)
3. I really need advice on how to enable this customer.
So OnActivate, I request a function that will result all the records that needed to be checked. In this function I call the function in the CU that will change the value and commit the change, but as you can guess, it results in the message "Transaciton needs to be started blablabla".
I know this is because I'm trying to start a write transaction in a trigger but can't I use a workaround?
I have a dilemma, but am sure this is something others also encountered. While opening a form, my code should look into another db to see if there is a value that needs updating. If so, the field in NAV will be updated.
1. I know this has performance issues but the custmer wants this to happen like this and a NAS service is out of the question sadly.
2. This is my first post, please be gentil :-)
3. I really need advice on how to enable this customer.
So OnActivate, I request a function that will result all the records that needed to be checked. In this function I call the function in the CU that will change the value and commit the change, but as you can guess, it results in the message "Transaciton needs to be started blablabla".
I know this is because I'm trying to start a write transaction in a trigger but can't I use a workaround?
0
Answers
-
In a standard database (W1), check form 118 (General Ledger Setup). OnOpenForm trigger inserts a default setup if it does not exists.
I hope this will inspire you to find the right solution for your case.1 -
If customer can approve, make a action instead to run your code, and also a progress window.
Often they open the page more often than the check needs to be done.
Take tecnical control when it comes to customers, help them make the right choices. This calls for NAS.Follow me on my blog juhl.blog1
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