Rename problem on form

BGI
Member Posts: 176
Here is a problem on witch i'm stuck for some days now.
- create a form with customer as source and a tablebox layout on it, with customerno, name and territory on it.
- create a field outside the tablebox, based on a global code variable. In this field we can enter a territory.
- On validate of codefield, do a customer.setfilter(territory,textfield)
Now everytime you enter a territory in the textfield and you click on a line in the tablebox, there is a textbox asking if you want to rename the record. <img border="0" title="" alt="[Confused]" src="images/smiles/icon_confused.gif" /> I think i found out that the problem is that the xrec didn't follow the setfilter so there is a difference between xrec and rec and from there the question to rename.
A solution could be to make a subform of the tablebox, but then i need an extra form for one control, all my buttons wil have to work with procedure on the subform etc...
Anyone found a solution to this ?
PS1. Currform.update(false) isn't allowed in onvalidate
PS2. I have the same problem on more complex forms (matrixes).
- create a form with customer as source and a tablebox layout on it, with customerno, name and territory on it.
- create a field outside the tablebox, based on a global code variable. In this field we can enter a territory.
- On validate of codefield, do a customer.setfilter(territory,textfield)
Now everytime you enter a territory in the textfield and you click on a line in the tablebox, there is a textbox asking if you want to rename the record. <img border="0" title="" alt="[Confused]" src="images/smiles/icon_confused.gif" /> I think i found out that the problem is that the xrec didn't follow the setfilter so there is a difference between xrec and rec and from there the question to rename.
A solution could be to make a subform of the tablebox, but then i need an extra form for one control, all my buttons wil have to work with procedure on the subform etc...
Anyone found a solution to this ?
PS1. Currform.update(false) isn't allowed in onvalidate
PS2. I have the same problem on more complex forms (matrixes).
Rgds
Benny Giebens
Benny Giebens
0
Comments
-
<img border="0" title="" alt="[Eek!]" src="images/smiles/icon_eek.gif" />
Sorry forgot one important thing.
after te setfilter on the onvalidate of the textfield, I have put following commmand; rec.find('-').
Why ?
Because otherwise in the form the record where you where positioned on, stays on the form in the firstline, even if that record doesn't match the filter.
Try it out in cronus, make the screen and you are positioned on a customer with a blanc region. Set a filter on foreign via the textfield, and in the lines there is still that first client displayed.
So a solution for one of these problems (the base problem of the wrong line being displayed, or the resulting error of the rename) would be grately appreciated.Rgds
Benny Giebens0 -
<img border="0" title="" alt="[Big Grin]" src="images/smiles/icon_biggrin.gif" /> <img border="0" title="" alt="[Big Grin]" src="images/smiles/icon_biggrin.gif" /> <img border="0" title="" alt="[Big Grin]" src="images/smiles/icon_biggrin.gif" /> <img border="0" title="" alt="[Big Grin]" src="images/smiles/icon_biggrin.gif" />
After 2 days of debugging and so on i didn't found an answer.
5 minutes after posting my problem on the forum, i found a solution.So its once more proven that this forum realy helps <img border="0" title="" alt="[Big Grin]" src="images/smiles/icon_biggrin.gif" /> <img border="0" title="" alt="[Big Grin]" src="images/smiles/icon_biggrin.gif" /> <img border="0" title="" alt="[Big Grin]" src="images/smiles/icon_biggrin.gif" />
Now for the solution. Just put the setfilter of the textvariable on the onaftervalidate() trigger instead of in the onvalidate() trigger.
Why ? Because there you can add as a second line currform.update() and there its allowed.
So now no boggy lines anymore after the setfilter, because the form gets updated correctly, and thus no more rename errors either.Rgds
Benny Giebens0
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