OK; Cancel Buttons

sabzamsabzam Member Posts: 1,149
Dear All,

I have got a small problem quite simplistic actually but it seems that I couldn't find a solution to it. I have created a form and I have added an extra button in the form. The form is by default created with the Ok and Cancel buttons. I have moved them to the side and they have stopped from showing up. Can anyone give me a reson for this and what should I do to make them appear as usual. To say the truth they are not essential but they certainly make a form look much more professional

Comments

  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    The default buttons only show up when the form is in lookupmode, like when you use F5 from the cardform of F6 from a related field.

    If you want it to behave differntly you can activate the LookupMode property or Change the Lookupmode by C/AL code.
  • DenSterDenSter Member Posts: 8,307
    The new form wizard puts those buttons on there by default. If you never intend to use your form as a lookup form, then you can safely remove them.
  • sabzamsabzam Member Posts: 1,149
    Thanks. I will do without them
  • CalicoCalico Member Posts: 31
    The default buttons only show up when the form is in lookupmode, like when you use F5 from the cardform of F6 from a related field.

    If you want it to behave differntly you can activate the LookupMode property or Change the Lookupmode by C/AL code.

    How do you change the LookupMode in C/AL?
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    e.g.
    CurrForm.LOOKUPMODE;
    
    [{Action} :=] FORM.RUNMODAL(Number [, Record] [, Field]) when Action is ACTION::LookupOK
    
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • CalicoCalico Member Posts: 31
    e.g.
    CurrForm.LOOKUPMODE;
    
    [{Action} :=] FORM.RUNMODAL(Number [, Record] [, Field]) when Action is ACTION::LookupOK
    

    ...but this is not changing the LOOKUPMODE. I know you can change it in the form's properties, and I know you can find out what it is (IF CurrForm.LOOKUPMODE THEN ...) but I would like to know if it is possible to change it dynamically in code.
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    This was more of an example where you can find more about this topic. If you had a deeper look into the online help then you should see there is a parameter in the LOOKUPMODE function called NewLookupMode...
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • louagejlouagej Member Posts: 5
    Or just go to the 'InvalidActionAppearance' property of your button, and set it to 'Normal'
    \:D/
  • Mike_HWGMike_HWG Member Posts: 104
    Calico, einsTeIn.NET provided you with the way to dynamically change the setting in his second snippet. Here's an example of how that would be used
    CustomerList.LOOKUPMODE := TRUE;
    IF(CustomerList.RUNMODAL = ACTION::LookupOK) THEN BEGIN
      // Do stuff
    END;
    

    If you want the form to change its own LOOKUPMODE... why??
    Michael Hollinger
    Systems Analyst
    NAV 2009 R2 (6.00.34463)
  • David_SingletonDavid_Singleton Member Posts: 5,479
    sabzam wrote:
    Dear All,

    I have got a small problem quite simplistic actually but it seems that I couldn't find a solution to it. I have created a form and I have added an extra button in the form. The form is by default created with the Ok and Cancel buttons. I have moved them to the side and they have stopped from showing up. Can anyone give me a reson for this and what should I do to make them appear as usual. To say the truth they are not essential but they certainly make a form look much more professional

    After they show you the coffee machine, placement of OK/Cancel is one of the first things taught in the C/AL course. It is before Navision 101.

    Read the Style guide that tells you if you add new buttons to a list form then you move the OK/Cancel to the left OR i OK/Cancel is not needed the (as Denster points out) you delete them.
    David Singleton
Sign In or Register to comment.