Removing Toolbar items like 'Delete' or 'New' in E10

In 701 we use a BPM for some delete methods and tie it to the security group if that helps.

For example only users in the Team Leaders group can delete cases.We use and error pop up to inform the user they need to go to the TL to delete if they need to.

Kind Regards
Simon Hall

In Vantage 8 I had this code to remove tool bar options. all of this code works except Delete. Does anyone know what the code should be now to remove the delete option from the Toolbar?


Vantage 8 code:

Sub disableTools()

    if tools.Tools.Exists("FileMenu")
        tools.Tools("FileMenu").SharedProps.Enabled = false
    end if
   
    if tools.Tools.Exists("EditMenu")
        tools.Tools("EditMenu").SharedProps.Enabled = false
    end if
   
    if tools.Tools.Exists("ActionsMenu")
        tools.Tools("ActionsMenu").SharedProps.Enabled = false
    end if
   
    if (tools.Tools.Exists("DeleteTool"))
        if (tools.Toolbars.Exists("Standard Tools"))
            tools.Toolbars("Standard Tools").Tools("DeleteTool").InstanceProps.Visible = Infragistics.Win.DefaultableBoolean.False
        end if
    end if
   
    if (tools.Tools.Exists("NewTool"))
        if (tools.Toolbars.Exists("Standard Tools"))
            tools.Toolbars("Standard Tools").Tools("NewTool").InstanceProps.Visible = Infragistics.Win.DefaultableBoolean.False
        end if
    end if
       
    if (tools.Tools.Exists("NewMenuTool"))
        if (tools.Toolbars.Exists("Standard Tools"))
            tools.Toolbars("Standard Tools").Tools("NewMenuTool").InstanceProps.Visible = Infragistics.Win.DefaultableBoolean.False
        end if
    end if

End Sub

You no longer need to do that, you can simply remove the delete as shown

Go to any form -> Actions -> Options


Global Options

Delete Tool Location


Jose C Gomez
Software Engineer


T: 904.469.1524 mobile

Quis custodiet ipsos custodes?

On Tue, Mar 24, 2015 at 2:24 PM, amathis@... [vantage] <vantage@yahoogroups.com> wrote:
Â
<div>
  
  
  <p></p><p><span>In Vantage 8 I had this code to remove tool bar options. all of this code works except Delete. Does anyone know what the code should be now to remove the delete option from the Toolbar? </span></p><p><span><br></span></p><p><span>Vantage 8 code: </span></p><p><span>Sub disableTools()</span></p><p><span>Â Â Â  if tools.Tools.Exists(&quot;FileMenu&quot;)<br>Â Â Â Â Â Â Â  tools.Tools(&quot;FileMenu&quot;).SharedProps.Enabled = false<br>Â Â Â  end if<br>Â Â Â  <br>Â Â Â  if tools.Tools.Exists(&quot;EditMenu&quot;)<br>Â Â Â Â Â Â Â  tools.Tools(&quot;EditMenu&quot;).SharedProps.Enabled = false<br>Â Â Â  end if<br>Â Â Â  <br>Â Â Â  if tools.Tools.Exists(&quot;ActionsMenu&quot;)<br>Â Â Â Â Â Â Â  tools.Tools(&quot;ActionsMenu&quot;).SharedProps.Enabled = false<br>Â Â Â  end if<br>Â Â Â  <br>Â Â Â  if (tools.Tools.Exists(&quot;DeleteTool&quot;))<br>Â Â Â Â Â Â Â  if (tools.Toolbars.Exists(&quot;Standard Tools&quot;))<br>Â Â Â Â Â Â Â Â Â Â Â  tools.Toolbars(&quot;Standard Tools&quot;).Tools(&quot;DeleteTool&quot;).InstanceProps.Visible = Infragistics.Win.DefaultableBoolean.False<br>Â Â Â Â Â Â Â  end if<br>Â Â Â  end if<br>Â Â Â  <br>Â Â Â  if (tools.Tools.Exists(&quot;NewTool&quot;))<br>Â Â Â Â Â Â Â  if (tools.Toolbars.Exists(&quot;Standard Tools&quot;))<br>Â Â Â Â Â Â Â Â Â Â Â  tools.Toolbars(&quot;Standard Tools&quot;).Tools(&quot;NewTool&quot;).InstanceProps.Visible = Infragistics.Win.DefaultableBoolean.False<br>Â Â Â Â Â Â Â  end if<br>Â Â Â  end if<br>Â Â Â Â Â Â Â  <br>Â Â Â  if (tools.Tools.Exists(&quot;NewMenuTool&quot;))<br>Â Â Â Â Â Â Â  if (tools.Toolbars.Exists(&quot;Standard Tools&quot;))<br>Â Â Â Â Â Â Â Â Â Â Â  tools.Toolbars(&quot;Standard Tools&quot;).Tools(&quot;NewMenuTool&quot;).InstanceProps.Visible = Infragistics.Win.DefaultableBoolean.False<br>Â Â Â Â Â Â Â  end if<br>Â Â Â  end if</span></p><p><span>End Sub</span></p><p></p>

</div>
 


<div style="color:#fff;min-height:0;"></div>

Jose,


I am aware of that way, however, on this 1 form is two customizations. One I want the delete button and on the other I do not. If I do it your way it will remove it from everything. Any ideas?

Sounds like you are trying to control groups of people, have you thought about using security in general vs focusing on the button. It would be more global that way?

 

Joshua Giese

CIO

 

Direct:     920.593.8299

IT Dept:   920.437.6400 Ext. 337

Site ID:    27450-E905702A-SQL64

Wisconsin Converting, Inc.

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Tuesday, March 24, 2015 1:38 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Removing Toolbar items like 'Delete' or 'New' in E10

 

 

Jose,

 

I am aware of that way, however, on this 1 form is two customizations. One I want the delete button and on the other I do not. If I do it your way it will remove it from everything. Any ideas?

#SIGH silly me....
ok the "Hard Way"

On Form_Load
baseToolbarsManager.Toolbars["Standard Tools"].Tools.Remove(baseToolbarsManager.Tools["DeleteTool"]);


Jose C Gomez
Software Engineer


T: 904.469.1524 mobile

Quis custodiet ipsos custodes?

On Tue, Mar 24, 2015 at 2:38 PM, amathis@... [vantage] <vantage@yahoogroups.com> wrote:
Â
<div>
  
  
  <p></p><p>Jose,</p><p><br></p><p>I am aware of that way, however, on this 1 form is two customizations. One I want the delete button and on the other I do not. If I do it your way it will remove it from everything. Any ideas?<br></p><p></p>

</div><span class="ygrps-yiv-1936725382">
 


<div style="color:#fff;min-height:0;"></div>

Jose,


Thank you sir! And Joshua this only happens on a few screens, so I'd rather just do this and not go down the rabbit hole of tweaking security. Thank you all!

darn it, you poked the bear, no I've got to say that doing it this way instead of the security route is kinda crazy. They can still hit the delete button on the keyboard or go to File-> Delete.... modifying security is certainly the way to go. I thought you were just trying to avoid them accidental hitting the delete button (a well known issue, hence the "move delete tool" feature).
But if you are trying trying to stop someone from deleting the record there is no better way than changing  the security on the BO.

Now do as you wish but I had to get this out there to make sure everyone else doesn't assume that this is a solution to something can can and should be handled by security.

Thanks!


Jose C Gomez
Software Engineer


T: 904.469.1524 mobile

Quis custodiet ipsos custodes?

On Tue, Mar 24, 2015 at 2:43 PM, amathis@... [vantage] <vantage@yahoogroups.com> wrote:
Â
<div>
  
  
  <p></p><p>Jose,</p><p><br></p><p>Thank you sir! And Joshua this only happens on a few screens, so I&#39;d rather just do this and not go down the rabbit hole of tweaking security. Thank you all!<br></p><p></p>

</div><span class="ygrps-yiv-2116020067">
 


<div style="color:#fff;min-height:0;"></div>

They can't do file delete because I disabled that in the above code. That worked just fine, however, the delete from the keyboard is something. I will have to look into. THanks for mentioning.
haha really man? you are going to customize 3 different functions(toolbar, file->delete and delete from keyboard) on a few screens just so that you don't have to click disallow on the BO Security screen? you are killing me. I'let it go! but you should seriously consider using the security, its maintainable, upgrade safe, requires 0 programming and it works across the framework (web services, direct BO calls, BAQs , BPMs etc)
As you yourself saw in the 8-10 transition customization's are not upgrade safe (hence why you needed new code)




Jose C Gomez
Software Engineer


T: 904.469.1524 mobile

Quis custodiet ipsos custodes?

On Tue, Mar 24, 2015 at 3:00 PM, amathis@... [vantage] <vantage@yahoogroups.com> wrote:
Â
<div>
  
  
  <p>They can&#39;t do file delete because I disabled that in the above code. That worked just fine, however, the delete from the keyboard is something. I will have to look into. THanks for mentioning.</p>

</div><span class="ygrps-yiv-1072070871">
 


<div style="color:#fff;min-height:0;"></div>