Stop changing key on form

vijay_gvijay_g Member Posts: 884
Hi all,
how can i prevent a user for changing key on form at run time.


Vijay Gupta

Comments

  • kapamaroukapamarou Member Posts: 1,152
    Haven't tried it, bu you could try: Tools -> Security -> Roles -> Permissions.

    Under Object Type -> System you'll find
    System 3410 View, Sort
  • David_SingletonDavid_Singleton Member Posts: 5,479
    vijay_g wrote:
    Hi all,
    how can i prevent a user for changing key on form at run time.


    Vijay Gupta


    It's called "Training". :mrgreen:
    David Singleton
  • David_SingletonDavid_Singleton Member Posts: 5,479
    kapamarou wrote:
    Haven't tried it, bu you could try: Tools -> Security -> Roles -> Permissions.

    Under Object Type -> System you'll find
    System 3410 View, Sort

    But that would stop it on every form.
    David Singleton
  • kapamaroukapamarou Member Posts: 1,152
    kapamarou wrote:
    Haven't tried it, bu you could try: Tools -> Security -> Roles -> Permissions.

    Under Object Type -> System you'll find
    System 3410 View, Sort

    But that would stop it on every form.

    Indeed...
  • matteo_montanarimatteo_montanari Member Posts: 189
    vijay_g wrote:
    Hi all,
    how can i prevent a user for changing key on form at run time.


    Vijay Gupta

    A simple & localized solution could be:
    Form - OnAfterGetRecord()
    VAR
      tableLoc: same table as rec
    
    IF GETCURRENTKEY <> tableLoc.GETCURRENTKEY THEN
      ERROR('Don''t change the key');
    

    can it help you?

    bye

    matteo
    Reno Sistemi Navision Developer
  • kapamaroukapamarou Member Posts: 1,152
    Eto wrote:
    vijay_g wrote:
    Hi all,
    how can i prevent a user for changing key on form at run time.


    Vijay Gupta

    A simple & localized solution could be:
    Form - OnAfterGetRecord()
    VAR
      tableLoc: same table as rec
    
    IF GETCURRENTKEY <> tableLoc.GETCURRENTKEY THEN
      ERROR('Don''t change the key');
    

    can it help you?

    bye

    matteo


    Won't this close the form?
  • matteo_montanarimatteo_montanari Member Posts: 189
    kapamarou wrote:
    Eto wrote:
    vijay_g wrote:
    Hi all,
    how can i prevent a user for changing key on form at run time.


    Vijay Gupta

    A simple & localized solution could be:
    Form - OnAfterGetRecord()
    VAR
      tableLoc: same table as rec
    
    IF GETCURRENTKEY <> tableLoc.GETCURRENTKEY THEN
      ERROR('Don''t change the key');
    

    can it help you?

    bye

    matteo


    Won't this close the form?

    yes. After some errors user will stop to try to change the default key.
    Something like Homer and an electrified cake... or not? ;)

    You can change it to:
    IF GETCURRENTKEY <> tableLoc.GETCURRENTKEY THEN
      SETCURRENTKEY(PrimaryKey);
    

    Matteo
    Reno Sistemi Navision Developer
  • vijay_gvijay_g Member Posts: 884
    It's called "Training". :mrgreen:

    hi David,
    as everybody know navision is a big tool and everybody is a learner and i m also a lerner who is here enhance my knowledge from my seniours who is supporting through this site but some persons like Mr. David is demoralising. :(
  • David_SingletonDavid_Singleton Member Posts: 5,479
    vijay_g wrote:
    It's called "Training". :mrgreen:

    hi David,
    as everybody know navision is a big tool and everybody is a learner and i m also a lerner who is here enhance my knowledge from my seniours who is supporting through this site but some persons like Mr. David is demoralising. :(


    So why don't you just say what you want to hear and I will tell you that its a perfect solution.

    "My customer thinks its too hard to reverse and invoice can I just delete the tables in SQL?" If I answer "NO you must train the user" then I am demoralizing, but if I say "Yes go ahead" then you are happy.

    What is the point of asking for advise if you don't want to hear the answer.

    I stand by my answer that you should train the users, not simply write code every time they do something wrong.
    David Singleton
  • matttraxmatttrax Member Posts: 2,309
    I stand by my answer that you should train the users, not simply write code every time they do something wrong.

    I completely agree. Sorting is a VERY basic feature of the product. If users can't understand how it works then there are problems. How long can it really take to explain it? 2 minutes?
  • DenSterDenSter Member Posts: 8,304
    vijay_g wrote:
    i m also a lerner who is here enhance my knowledge from my seniours who is supporting through this site
    Learners should be good listeners, and it doesn't look like you want to be listening to advice that you don't like. Listen to the advice that is available, and try to extract the information from it. If you don't understand advice, ask for clarification. I can assure you that everyone on this forum always tries to give useful answers.
    vijay_g wrote:
    some persons like Mr. David is demoralising. :(
    What is demoralizing is taking some time to read someone's post, giving them the best answer you can give them, and then be insulted because the poster doesn't like the answer.
  • themavethemave Member Posts: 1,058
    Please explain the purpose of this, without you giving more detail we can't give an answer you may like. the sort doesn't effect much. other then when you use the navigation keys to move from one record to the next more or less. I think from the limited info given in the question, by far the best answer yet, is provide training to the users. so they know what they are doing. It likely will pay off may times over in the future. What are you going to do, edit every form to have the preferred sort. and then hard code in every form the restriction of changing the sort. then what happens, when you find a user really does need to change the sort. he won't be able to.

    just my random thoughts, as an end user who has benefited greatly over the years by listening to all the answer given on the forum with an open mind.
Sign In or Register to comment.