Rename problem on form

BGIBGI Member Posts: 176
edited 2002-10-09 in Navision Financials
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).
Rgds
Benny Giebens

Comments

  • BGIBGI Member Posts: 176
    <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 Giebens
  • BGIBGI Member Posts: 176
    <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 Giebens
Sign In or Register to comment.