Disable SO Print till someone approve

This is some code on a customization in 8.03 for a UD table where I hide or disable some menu items.  Maybe this will help you get started.  Remember to reference the Infragistics2.Win.UltraWinToolbars.v6 assembly in your customization.

Option Compare Text
Imports System
Imports System.Data
Imports System.IO
Imports System.Diagnostics
Imports System.Windows.Forms
Imports System.ComponentModel
Imports System.Math
Imports System.Drawing
Imports System.Text
Imports Microsoft.VisualBasic
Imports Epicor.Mfg.UI
Imports Epicor.Mfg.UI.FrameWork
Imports Epicor.Mfg.UI.ExtendedProps
Imports Epicor.Mfg.UI.FormFunctions
Imports Epicor.Mfg.UI.Customization
Imports Epicor.Mfg.UI.Adapters
Imports Epicor.Mfg.UI.Searches
Imports Epicor.Mfg.BO
Imports System.collections
Imports System.Reflection
Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid
Imports Ingragistics.Win.UltraTreeView
Imports System.CodeDom.Compiler
.
.
.
.
.
    '// Add Custom Module Level Variables Here ** 

    Dim bm As BindingManagerBase
    dim tools as Infragistics.Win.UltraWinToolbars.UltraToolbarsManager
    Private UD105Adapter As UD105Adapter
    Private PartAdapter As PartAdapter

    Sub InitializeCustomCode() 

        UD105Adapter = New UD105Adapter(oTrans)
        UD105Adapter.BOConnect()

        UD15Adapter = New UD15Adapter(oTrans)
        UD15Adapter.BOConnect()

        PartAdapter = New PartAdapter(oTrans)
        PartAdapter.BOConnect()
        
        CustomerAdapter = New CustomerAdapter(oTrans)
        CustomerAdapter.BOConnect()


        '// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Intialization' lines ** 
        '// Begin Wizard Added Variable Intialization 

        oTrans_adapter = csm.TransAdaptersHT("oTrans_adapter")
        edvUD105A = CType(oTrans.EpiDataViews("UD105A"), EpiDataView)
        edvUD105 = CType(oTrans.EpiDataViews("UD105"), EpiDataView)
        edvUD15 = CType(oTrans.EpiDataViews("UD15"), EpiDataView)
        OrderPanel = CType(csm.GetNativeControlReference("55046059-f021-4c4f-a481-d8b56abb1768"), EpiBasePanel)
'        UD105A_DataView = UD105A_Row.dataView
        
        '// End Wizard Added Variable Intialization 
        '// Begin Custom Method Calls 
        
        dim obj as Object = GetType(Epicor.Mfg.UI.App.UD105Entry.UD105Form).InvokeMember("baseToolbarsManager", BindingFlags.Instance Or BindingFlags.GetField Or BindingFlags.NonPublic, Nothing, UD105Form, Nothing)
        tools = ctype(obj,Infragistics.Win.UltraWinToolbars.UltraToolbarsManager)
        disableTools()

        CreateRowRuleUD105AChildKey1Contains_Key2()
        '// End Custom Method Calls 
        
    End Sub 

    Sub disableTools( )
'        if tools.Tools.Exists("DeleteTool")
'            tools.Tools("DeleteTool").SharedProps.Visible = False 
'        end if
        if tools.Tools.Exists("FileMenu")
            tools.Tools("FileMenu").SharedProps.Enabled = false 
        end if
        if tools.Tools.Exists("NewMenuTool")
            tools.Tools("NewMenuTool").SharedProps.Enabled = false
        end if
    End Sub


Steven G.


On Tuesday, October 14, 2014 3:49 PM, "Sherin Salim sherinsalim@... [vantage]" <vantage@yahoogroups.com> wrote:


 
<div id="ygrps-yiv-928164205yiv3769985024ygrp-text">
  
  
  <div>
Hi,
We are running E905 and we need to do a customization to disable print command in Sales Order screen till somebody click a custom checkbox to Approve. (Same as Quote Form, which disables print until someone click â€œquoted” checkbox.)

Appreciate if someone send the process to follow.

Regards
Sherin

Sent from Windows Mail

</div>
 


<div style="color:#fff;height:0;"></div></div>
#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024 -- #ygrps-yiv-928164205yiv3769985024ygrp-mkp { border:1px solid #d8d8d8;font-family:Arial;margin:10px 0;padding:0 10px;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024ygrp-mkp hr {
border:1px solid #d8d8d8;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024ygrp-mkp #ygrps-yiv-928164205yiv3769985024hd {
color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px 0;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024ygrp-mkp #ygrps-yiv-928164205yiv3769985024ads {
margin-bottom:10px;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024ygrp-mkp .ygrps-yiv-928164205yiv3769985024ad {
padding:0 0;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024ygrp-mkp .ygrps-yiv-928164205yiv3769985024ad p {
margin:0;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024ygrp-mkp .ygrps-yiv-928164205yiv3769985024ad a {
color:#0000ff;text-decoration:none;}
#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024ygrp-sponsor #ygrps-yiv-928164205yiv3769985024ygrp-lc {
font-family:Arial;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024ygrp-sponsor #ygrps-yiv-928164205yiv3769985024ygrp-lc #ygrps-yiv-928164205yiv3769985024hd {
margin:10px 0px;font-weight:700;font-size:78%;line-height:122%;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024ygrp-sponsor #ygrps-yiv-928164205yiv3769985024ygrp-lc .ygrps-yiv-928164205yiv3769985024ad {
margin-bottom:10px;padding:0 0;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024actions {
font-family:Verdana;font-size:11px;padding:10px 0;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024activity {
background-color:#e0ecee;float:left;font-family:Verdana;font-size:10px;padding:10px;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024activity span {
font-weight:700;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024activity span:first-child {
text-transform:uppercase;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024activity span a {
color:#5085b6;text-decoration:none;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024activity span span {
color:#ff7900;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024activity span .ygrps-yiv-928164205yiv3769985024underline {
text-decoration:underline;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 .ygrps-yiv-928164205yiv3769985024attach {
clear:both;display:table;font-family:Arial;font-size:12px;padding:10px 0;width:400px;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 .ygrps-yiv-928164205yiv3769985024attach div a {
text-decoration:none;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 .ygrps-yiv-928164205yiv3769985024attach img {
border:none;padding-right:5px;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 .ygrps-yiv-928164205yiv3769985024attach label {
display:block;margin-bottom:5px;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 .ygrps-yiv-928164205yiv3769985024attach label a {
text-decoration:none;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 blockquote {
margin:0 0 0 4px;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 .ygrps-yiv-928164205yiv3769985024bold {
font-family:Arial;font-size:13px;font-weight:700;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 .ygrps-yiv-928164205yiv3769985024bold a {
text-decoration:none;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 dd.ygrps-yiv-928164205yiv3769985024last p a {
font-family:Verdana;font-weight:700;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 dd.ygrps-yiv-928164205yiv3769985024last p span {
margin-right:10px;font-family:Verdana;font-weight:700;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 dd.ygrps-yiv-928164205yiv3769985024last p span.ygrps-yiv-928164205yiv3769985024yshortcuts {
margin-right:0;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 div.ygrps-yiv-928164205yiv3769985024attach-table div div a {
text-decoration:none;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 div.ygrps-yiv-928164205yiv3769985024attach-table {
width:400px;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 div.ygrps-yiv-928164205yiv3769985024file-title a, #ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 div.ygrps-yiv-928164205yiv3769985024file-title a:active, #ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 div.ygrps-yiv-928164205yiv3769985024file-title a:hover, #ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 div.ygrps-yiv-928164205yiv3769985024file-title a:visited {
text-decoration:none;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 div.ygrps-yiv-928164205yiv3769985024photo-title a, #ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 div.ygrps-yiv-928164205yiv3769985024photo-title a:active, #ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 div.ygrps-yiv-928164205yiv3769985024photo-title a:hover, #ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 div.ygrps-yiv-928164205yiv3769985024photo-title a:visited {
text-decoration:none;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 div#ygrps-yiv-928164205yiv3769985024ygrp-mlmsg #ygrps-yiv-928164205yiv3769985024ygrp-msg p a span.ygrps-yiv-928164205yiv3769985024yshortcuts {
font-family:Verdana;font-size:10px;font-weight:normal;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 .ygrps-yiv-928164205yiv3769985024green {
color:#628c2a;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 .ygrps-yiv-928164205yiv3769985024MsoNormal {
margin:0 0 0 0;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 o {
font-size:0;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024photos div {
float:left;width:72px;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024photos div div {
border:1px solid #666666;height:62px;overflow:hidden;width:62px;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024photos div label {
color:#666666;font-size:10px;overflow:hidden;text-align:center;white-space:nowrap;width:64px;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024reco-category {
font-size:77%;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024reco-desc {
font-size:77%;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 .ygrps-yiv-928164205yiv3769985024replbq {
margin:4px;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024ygrp-actbar div a:first-child {
margin-right:2px;padding-right:5px;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024ygrp-mlmsg {
font-size:13px;font-family:Arial, helvetica, clean, sans-serif;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024ygrp-mlmsg table {
font-size:inherit;font:100%;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024ygrp-mlmsg select, #ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 input, #ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 textarea {
font:99% Arial, Helvetica, clean, sans-serif;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024ygrp-mlmsg pre, #ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 code {
font:115% monospace;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024ygrp-mlmsg * {
line-height:1.22em;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024ygrp-mlmsg #ygrps-yiv-928164205yiv3769985024logo {
padding-bottom:10px;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024ygrp-msg p a {
font-family:Verdana;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024ygrp-msg p#ygrps-yiv-928164205yiv3769985024attach-count span {
color:#1E66AE;font-weight:700;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024ygrp-reco #ygrps-yiv-928164205yiv3769985024reco-head {
color:#ff7900;font-weight:700;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024ygrp-reco {
margin-bottom:20px;padding:0px;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024ygrp-sponsor #ygrps-yiv-928164205yiv3769985024ov li a {
font-size:130%;text-decoration:none;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024ygrp-sponsor #ygrps-yiv-928164205yiv3769985024ov li {
font-size:77%;list-style-type:square;padding:6px 0;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024ygrp-sponsor #ygrps-yiv-928164205yiv3769985024ov ul {
margin:0;padding:0 0 0 8px;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024ygrp-text {
font-family:Georgia;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024ygrp-text p {
margin:0 0 1em 0;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024ygrp-text tt {
font-size:120%;}

#ygrps-yiv-928164205 #ygrps-yiv-928164205yiv3769985024 #ygrps-yiv-928164205yiv3769985024ygrp-vital ul li:last-child {
border-right:none !important;}
#ygrps-yiv-928164205



Hi,
We are running E905 and we need to do a customization to disable print command in Sales Order screen till somebody click a custom checkbox to Approve. (Same as Quote Form, which disables print until someone click â€œquoted” checkbox.)

Appreciate if someone send the process to follow.

Regards
Sherin

Sent from Windows Mail