Options

OK Button on Custom Page

dhitzemanndhitzemann Member Posts: 6
edited 2010-09-29 in NAV Three Tier
I have a question. I have created several new forms and transformed them into pages. All the functionality seems to be working fine. The only issue I am having is there is an OK button on the lower right hand corner of the page. I did not put it there. When "clicked" it performs as a cancel button. This is a problem as the page allows users to enter a bunch of stuff and then do an "action" to process the codeunit. If they hit this OK button, nothing gets processed.

I need to either
a. Get rid of this button as it is unnecessary
b. Find where I can put some functionality behind the button so I can get it to act in the same fashion as my "action".

Any help would be appreciated.

Comments

  • Options
    SanSan Member Posts: 6
    I've got the same problem and have not yet found a solution. Have you been successfull?
  • Options
    dhitzemanndhitzemann Member Posts: 6
    Yes, well not so much a solution as a work around. I was able to change the page type to a NavigatePage. It retained the code and added the "Post" action that I had as a button to the bottom of the page (you have to change the Action property "InFooterBar" to yes) and then I got two buttons, one with my functionality on it, and the "OK" changed to "Close" which is more appropriate. Now I was unable to remove it, but by adding the second button it should eliminate user confusion.
  • Options
    freddy.dkfreddy.dk Member, Microsoft Employee Posts: 360
    It isn't recommended to use page type NavigatePage for other pages than the Navigate Page.
    The rendering and functionality of that page is very specific and these things might change in future versions.

    The OK button appears in various situations - in your situation I guess it is because you are opening a Task page which is bound to a record.

    Couldn't you write your code in OnQueryClosePage?
    Freddy Kristiansen
    Group Program Manager, Client
    Microsoft Dynamics NAV
    http://blogs.msdn.com/freddyk

    The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
  • Options
    dhitzemanndhitzemann Member Posts: 6
    The page in question is not bound to a record, it is more of a worksheet. Several fields are scanned in, then it attaches to Production Order Routing Line and creates an automatic Output journal posting for time and inputed quantity against the Operation No.
    I can move some of the code onto the OnQueryClose but I have to give my users the option of getting out of the page without posting and also clearing the page after posting to make another entry without having to close it and re-open.
    I considered the OnQueryClose option but it made more sense to change the page type and add the second button at the bottom because users were just clicking "OK" expecting their work to process and it just closes the form and deletes their input.

    Also why does the button say "OK"? That is misleading. It should say "Close" or "Cancel" as that is it's function. Also why do I not have control over whether it is there or not. I really just want to eliminate it completely, but that is not an option.

    Is there another page type I can use for this which will not give me a button at the bottom but will still allow for the functionality I need?
  • Options
    matttraxmatttrax Member Posts: 2,309
    Yeah, as I've been transforming more and more pages I've found that this button is appearing on almost all of them. It's especially annoying on Sales and Purchase Orders. It's just there and serves no purpose. Surely there is a way to get it to go away.
  • Options
    genericgeneric Member Posts: 511
    The OK button is there for a reason.

    The current version it's there because of GUI guidelines that MS has. For example if you right click on your desktop and click on properties the window will have an OK, and nobody has complained about that. Well maybe some.


    My guess in future, they will have an Apply button so that your data will be modified only if you click OK, Apply,
    but that is just a guess.
  • Options
    dhitzemanndhitzemann Member Posts: 6
    The problem Generic is you do not do any processing on the window you are talking about. If I was bringing up a factbox or something that just displays information, that is one thing, but when your users need to use a function to post or something and that box is there, it can cause confusion, especially in less than computer literate users.

    mattrax if you find a way to get rid of it, let me know. I have not been able to do it.
  • Options
    SanSan Member Posts: 6
    I'm a bit satisfied, that I'm not the only one having this problem. Although I'd be even more satisfied, if a good solution for this problem exists.
    On my form, the user can import a file by pushing a Command Button. On the page, this Command Button is placed in the Process section of the Action Pane. The OK-Button on this page can mislead the customer. He might think he started the import, although the OK-Button does nothing besides clothing the page.
    I'd be very grateful if the OK-Button would either get another name or if we would get the possibility to deactivate it.
  • Options
    awarnawarn Member Posts: 261
    Hi,

    did you find a good answer to this? I would like the user to either press OK (to apply the changes that they did on my form), or press Cancel or Escape to cancel the editing.

    I can promote my form OK button - but it appears on the top left of the page - so there is one OK button that works, and one OK button that does nothing!!!

    -awarn
  • Options
    SanSan Member Posts: 6
    Unfortunately we didn't find the solution we wished and finally changed some of the functionality of our form.

    We also had an MPO-support case for this and maybe the answer to this might help you.

    Answer to our MPO-support case:

    I'm sorry, but there is no standard Page as you would like.
    In effect, you can setup the Data and Actions inside the Page in the Page Designer, but you cannot setup the appearance of the window: all Pages have a "OK", or a "Close" button.

    Since you cannot eliminate the added buttons by the Role tailored Client application, the best way is to use it for your own needs.
    The code in the trigger 'Form - OnQueryCloseForm() : Boolean" is send by the Transformation Tool the trigger "OnQueryClosePage(CloseAction : Action None) : Boolean". It is then interesting to use the close trigger (you do not need add button in the Form since this trigger is used too by the Red close box on top right on any window) instead of your own "Import" button, even if it is not right.
    If you really would like a nice Form and Page design, you will have no other choice than to develop it separately.
Sign In or Register to comment.