SETRANGE("NO.") IN FORM EMPLOYEE CARD

elysavalelysaval Member Posts: 24
HI, DOES SOMEBODY KNOW WHY IN FORM 5200 EMPLOYEE CARD TRIGGER ONAFTERGETRECORD THERE IS THE CODE

SETRANGE("No.");

WITH THIS CODE IF YOU MAKE A FILTER ON THE PRIMARY KEY THE FORM DOESN'T KEEP IT ! :-k

THANKS.

ELISA.

Comments

  • navisi0nenavisi0ne Member Posts: 36
    the same code is in all master data card.
    I think is to avoid that user insert new record without seeing them.
  • AlishaAlisha Member Posts: 217
    This code is there to be able to move backward and forward when you access to a card from a list.
    For example, if you are on the Customer list (form 22), and push Customer --> Card, if this code wasn't there, you couldn't move to the next customer card, because the Card form will be filtered only for that customer.
  • navisi0nenavisi0ne Member Posts: 36
    Alisha wrote:
    This code is there to be able to move backward and forward when you access to a card from a list.
    For example, if you are on the Customer list (form 22), and push Customer --> Card, if this code wasn't there, you couldn't move to the next customer card, because the Card form will be filtered only for that customer.
    When you open a Card from the List, the list doesn't set any filter.
    The card form doesn't inherit filter from List form, it is true the opposite.
    Just try to comment the code and run the form.
  • krikikriki Member, Moderator Posts: 9,118
    elysaval wrote:
    HI, DOES SOMEBODY KNOW WHY IN FORM 5200 EMPLOYEE CARD TRIGGER ONAFTERGETRECORD THERE IS THE CODE

    SETRANGE("No.");

    WITH THIS CODE IF YOU MAKE A FILTER ON THE PRIMARY KEY THE FORM DOESN'T KEEP IT ! :-k

    THANKS.

    ELISA.
    BTW : no need to YELL. We also hear (...read...) you when you don't yell.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • AlishaAlisha Member Posts: 217
    navisi0ne wrote:
    Alisha wrote:
    This code is there to be able to move backward and forward when you access to a card from a list.
    For example, if you are on the Customer list (form 22), and push Customer --> Card, if this code wasn't there, you couldn't move to the next customer card, because the Card form will be filtered only for that customer.
    When you open a Card from the List, the list doesn't set any filter.
    The card form doesn't inherit filter from List form, it is true the opposite.
    Just try to comment the code and run the form.


    If you comment the code, when you reach the card from the list, you won't be able to move to another cards.
  • navisi0nenavisi0ne Member Posts: 36
    Alisha wrote:
    If you comment the code, when you reach the card from the list, you won't be able to move to another cards.
    You're right, I was thinking about switch from Card to List and again to Card by clicking OK on the list, not by open the Card from the list.
    :oops:
  • kinekine Member Posts: 12,562
    This code is used to prevent "problems" when you set filter for the PK, you close the form and someone delete the card. In this case without this code you will be not able to open the form (there will be error that you cannot use manual nos. if they are disabled on the no. series) etc.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • ShenpenShenpen Member Posts: 386
    Kine

    Oh, so *this* was the reason I always needed to tell users to delete fin.zup in NAV3.6 because of filters stuck on deleted records - this one line was missing :)

    Do It Yourself is they key. Standard code might work - your code surely works.
  • kinekine Member Posts: 12,562
    Exactly... :-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.