copy field after modification
vios15
Member Posts: 43
Dear Expert,
I am trying to capture the old field data to another field after modification.
eg. in the form, existing bin_location field I would like to change from "ABC" to "DEF", after changing, bin_location becomes "DEF" while Old_bin Location captured as "ABC".
How do I achieve it?
Thanks
I am trying to capture the old field data to another field after modification.
eg. in the form, existing bin_location field I would like to change from "ABC" to "DEF", after changing, bin_location becomes "DEF" while Old_bin Location captured as "ABC".
How do I achieve it?
Thanks
0
Answers
-
set Old_bin Location = Xrec.value;0
-
Hi,
Thanks.
It work after change it from the Form OnInputChange but I discovered that I need to move to next record in order for the change to take effect.
Is it possible to update the change the moment my cursor leave the Bin_location.
Thanks again.0 -
in which trigger you have written the code/vios15 wrote:Hi,
Thanks.
It work after change it from the Form OnInputChange but I discovered that I need to move to next record in order for the change to take effect.
Is it possible to update the change the moment my cursor leave the Bin_location.
Thanks again.0 -
Hi,
OnInputChange at the Bin_location.0 -
write it in OnValidate of Bin_location.0
-
Hi,
The result is the same, need to move to next record before being updated.
I can see the Old_Bin Location being updated in the Form after changing the Bin_Location, if I hit "escape" key after leaving Bin_Location field, my record is not updated. If I press down arrow key to next record, my changes would take effect.
Could it be other control in place?
Thanks.0 -
i have performed this in Purchase order subform(Purchase line table) .
i have created new field called newitem
i have writen code in No. onvalidate trigger
its working fine.
after changing the item No., newitem field is automatically filled without moving to next record or pres down arrow.0 -
You should never put this type of data manipulation code on forms. This should go into the OnValidate trigger of the field itself, in the table, not on the form.vios15 wrote:OnInputChange at the Bin_location.0 -
Hi,
Thanks for the advice. Will take note.
By the way, I know why in the FORM, not updated after leaving the field.
From further search in mibuso, all I need to do, is to insert "Currform.Update(True)" into OnafterValidate.
Problem solved.
Thanks0 -
Well solved... you made it work, which is always a good thing, but I would not call it a solution. In medical terms you have treated a symptom, but did not cure the patient
. It is still not a good idea to put code like that on the form.
What if you need to create another form for the same table? Now you're going to have to look through all the code in this other form and decide what to copy, and managing versions will become more difficult. Code that handles validation should be written in the table triggers, not on the form.0 -
Dear DenSter,
Thanks for the advise.
I have reverted my decision from Form to Table validation after some investigation.
Thanks0
Categories
- All Categories
- 73 General
- 73 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
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 333 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

