Remove Menu Button

 6 Replies
 0 Subscribed to this topic
 12 Subscribed to this forum
Sort:
Author
Messages
mondrar
Advanced Member
Posts: 35
Advanced Member

    Can anyone help me in hiding a button the the menu bar, i.e. On the PR12, hide the delete button, but still make it available under the drop down on the Inquire button.

    Changing the value of visible from 1 to 0 does not work, and neither does tp=hidden.

    Any ideas on how to accomplish this in design studio?

    John Henley
    Posts: 3353
      Try this code...I've used it in the past, not sure if it's what you're trying to do...
      var objToolBarBtn = lawForm.UIDocument.getElementById("LAWTBBUTTONtbBtnD");
      if (objToolBarBtn) {
      objToolBarBtn.style.visibility="hidden";
      Thanks for using the LawsonGuru.com forums!
      John
      mondrar
      Advanced Member
      Posts: 35
      Advanced Member

        Without getting fancy, using your example I can hide any button on a form using the simple javascript below, but when I try to hide any of the buttons on the tool bar, e.g. delete, Add, Change, the entire bar goes away, any ideas?

        function FORM_OnInit()
        {
         var objToolBarBtn = lawForm.UIDocument.getElementById("_l83");
         
         objToolBarBtn.style.visibility="hidden";
        }

        Jeremy
        Basic Member
        Posts: 7
        Basic Member
          Can this code also apply to text boxes and labels on the screen? It doesn't seem to work for me.
          David Williams
          Veteran Member
          Posts: 1127
          Veteran Member
            I've used this code to hide a button I added to a form:

            var psh10=lawForm.getFormElement("push10");
            psh10.style.visibility = "hidden";
            David Williams
            Jeremy
            Basic Member
            Posts: 7
            Basic Member
              Thanks, I was able to get it to work using:

              lawForm.getFormElement("text2").style.visibility = "hidden";

              On a side note, any way of adding options to Lawson's listbox object?
              David Williams
              Veteran Member
              Posts: 1127
              Veteran Member
                I've used the method in the attached file to add items to a ListBox based upon the selection of a RadioButton item.

                My ListBox was assigned to a Reason Code DataSource (I deleted the original Reason Code textbox) so users where limited to reason codes associated to the RadioButton selected.
                Attachments
                David Williams