How to set a new active Record in a form

MichaelBulla
Member Posts: 5
Hi,
can anybody tell me, how I can set the new active Record in a Form after the old one has been modified?
I have a form in that not every Record can been changed and I want to set the Cursor to the next possible Record after it has left the old one.
I've tried this, but it doesnt run correctly:
OnAfterValidate()
REPEAT
xRec.NEXT;
UNTIL xRec.Artikelnr <> '';
Thanks for help!
Bye Michael
If I do this I'm always asked "Wollen Sie den Datensatz umbenennen?" ja/nein (Do you wanna rename this record? yes/no).
If I klick on no, the right record is selected and the changes are overtaken to the old one, but if this message always appears, it makes working impossible. Maybe me is helped, if somebody can tell me, what this message means.
By the way: Now I've played my form totally broken. If I press Return at any field in the form, it doesnt effect anything if the field wasnt changed. So I can only go around with the arrow- buttons. This happens even, if I remove the above showed code. Has anybody an idea?
Bye Michael
can anybody tell me, how I can set the new active Record in a Form after the old one has been modified?
I have a form in that not every Record can been changed and I want to set the Cursor to the next possible Record after it has left the old one.
I've tried this, but it doesnt run correctly:
OnAfterValidate()
REPEAT
xRec.NEXT;
UNTIL xRec.Artikelnr <> '';
Thanks for help!
Bye Michael
If I do this I'm always asked "Wollen Sie den Datensatz umbenennen?" ja/nein (Do you wanna rename this record? yes/no).
If I klick on no, the right record is selected and the changes are overtaken to the old one, but if this message always appears, it makes working impossible. Maybe me is helped, if somebody can tell me, what this message means.
By the way: Now I've played my form totally broken. If I press Return at any field in the form, it doesnt effect anything if the field wasnt changed. So I can only go around with the arrow- buttons. This happens even, if I remove the above showed code. Has anybody an idea?
Bye Michael
0
Comments
-
I'm not sure what are you trying to do, but you should never use xrec in this way. I hope you know what rec and xrec are used for...
Renaming record means you are changing the fields in primary key. During renaming all fileds in all tables that have table relation to the field in this primary key are also changed. so be careful.
After renaming record the position of your rec is likely to be somewhere else in index. so when runing next on this record can be ambigous.
Maybe you should start with explanation what do you want...®obi
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯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