Vantage 8.03 Order Entry Memos - Customization to make fields vi

Hi Jose,
Â
It works! Thank you so much for your time.
Â
Regards,
Linda


On Fri, Oct 4, 2013 at 1:07 PM, Jose Gomez <jose@...> wrote:

Â
<div>
  
  
  <p><div dir="ltr"><div class="ygrps-yiv-1183388293gmail_default" style="font-family:verdana, sans-serif;font-size:small;">remove the stuff from form load... there is no Args in form load that&#39;s where your error comes from.</div></div>



Jose C Gomez
Software Engineer



T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com

     Â


Quis custodiet ipsos custodes?


On Fri, Oct 4, 2013 at 12:13 PM, Linda Lowney <pridesignslinda@...> wrote:

Â
<div>
  
  
  <p></p><div dir="ltr"><div>Hi Jose,</div><div> </div><div>When I open the Memo entry screen I get an error message (see below.)  Complete customization is below error message. Once I get past the error message it works great, I get <font color="#000000" face="Times New Roman" size="3"><font face="Arial"><font color="#222222">my message popping up every time I expect it to so I guess it is stil related to there being no record when the form first loads.  You said to make sure args was &gt;= 0, but I&#39;m not sure how I&#39;m supposed to do that, since I&#39;m not even sure what &quot;args&quot; is, lol.</font></font></font><p>

Â

Â
Â

Error Detail

============

Exception has been
thrown by the target of an invocation.

Â

Â

Stack Trace

===========

  at
System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object arguments,
SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle
typeOwner)

  at
System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object arguments,
Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)

  at
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr,
Binder binder, Object parameters, CultureInfo culture, Boolean
skipVisibilityChecks)

  at
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr,
Binder binder, Object parameters, CultureInfo culture)

  at
Epicor.Mfg.UI.Customization.CustomScriptManager.OnCustomCodeFormLoad(Object
sender, EventArgs e)

Â

Inner Exception

===============

Unable to cast object of
type 'System.EventArgs' to type 'Epicor.Mfg.UI.FrameWork.EpiNotifyArgs'.

Â

Inner Stack Trace

=================

  at Script.MemoForm_Load(Object sender,
EventArgs args)

Â


Â

Here is the complete customization so far.


Â
'//**************************************************
'// Custom VB.NET code for MemoForm
'// Created: 10/4/2013 11:27:11 AM

'//**************************************************

Imports System
Imports System.Data
Imports System.Diagnostics
Imports System.Windows.Forms
Imports System.ComponentModel
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

Module Script
Â
 '// ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level Variables' Comments! **

 '// Begin Wizard Added Module Level Variables **
 Private WithEvents edvMemo As EpiDataView
 '// End Wizard Added Module Level Variables **Â
 '// Add Custom Module Level Variables Here **
 Sub InitializeCustomCode()
  '// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Intialization' lines **

  '// Begin Wizard Added Variable Intialization
  edvMemo = CType(oTrans.EpiDataViews("Memo"), EpiDataView)
  '// End Wizard Added Variable Intialization
      Â
  '// Begin Custom Method Calls

  '// End Custom Method Calls
 End Sub

 Sub DestroyCustomCode()
  '// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
  '// Begin Wizard Added Object Disposal

  edvMemo = Nothing
  '// End Wizard Added Object Disposal
  '// Begin Custom Code Disposal

  '// End Custom Code Disposal
 End Sub
 Private Sub MemoForm_Load(ByVal sender As object, ByVal args As EventArgs) Handles MemoForm.Load  Â

       edvMemo.notify(args)
  End Sub
 Private Sub edvMemo_EpiViewNotification(view As EpiDataView, args As EpiNotifyArgs) Handles edvMemo.EpiViewNotification
           messagebox.show("Notify event")    Â

   End Sub


End Module
Â
Â
Thanks again for all your help.
Â
Linda


On Fri, Oct 4, 2013 at 10:42 AM, Jose Gomez <jose@…> wrote:

Â
<div>
  
  
  <p></p><div dir="ltr"><div class="ygrps-yiv-1183388293gmail_default" style="font-family:verdana, sans-serif;font-size:small;">erm.. see what view those are tied to? That should work... What view are the boxes you are clicking linked to? Just remove all the IF THEN ELSE and  display a message box on notify period.</div>


Jose C Gomez
Software Engineer


T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com

     Â


Quis custodiet ipsos custodes?


On Fri, Oct 4, 2013 at 10:39 AM, Linda Lowney <pridesignslinda@...> wrote:

Â
<div>
  
  
  <p></p><div dir="ltr"><div>Hi Jose,</div><div> </div><div>Thank you for your response.  I opened memo entry and I clicked on various memos, but none of the message boxes popped up.  Am I doing something wrong?</div>
Â
Private Sub edvMemo_EpiViewNotification(view As EpiDataView, args As EpiNotifyArgs) ' Handles edvMemo.EpiViewNotification
        '// ** Argument Properties and Uses **
        '// view.dataView(args.Row)("[FieldName]")

        '// args.Row, args.Column, args.Sender, args.NotifyType
        '// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes


           messagebox.show("Notify")
           Select Case args.NotifyType
               case is = EpiTransaction.NotifyType.Initialize
                   messagebox.show("Initializing")

                   if (args.row >= 0) then
                       messagebox.show("row >= 0")
                   end if
               case is = EpiTransaction.NotifyType.AddRow
                If (args.Row > -1) Then

                     ' don't care about this one right now
                End If
            case else
                   messagebox.show("else statement")
            End Select
    End Sub

Â
Regards,
Linda
 Â


On Thu, Oct 3, 2013 at 4:42 PM, Jose Gomez <jose@...> wrote:

Â
<div>
  
  
  <p></p><div dir="ltr"><div class="ygrps-yiv-1183388293gmail_default" style="font-family:verdana, sans-serif;font-size:small;">Try using the Notify -&gt; Initialize event from the wizard. Jsut make sure that args.Row &gt;= 0</div></div><div class="ygrps-yiv-1183388293gmail_extra">



Jose C Gomez
Software Engineer



T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com

     Â


Quis custodiet ipsos custodes?


On Thu, Oct 3, 2013 at 4:40 PM, Linda Lowney <pridesignslinda@...> wrote:

Â
<div>
  
  
  <p></p><div dir="ltr"><font color="#000000" face="Times New Roman" size="3">

Hi Group,

Â

I want to create a customization that will set some user
fields visible or invisible depending on which Memo CategoryID is displayed on
the form. I tried using the Load event but it seems that no row is
available since I received the message Index -1 is either negative or above
rows count (I could be misunderstanding the error since I don’t know much about
vb.net.) Would someone please tell me which event I should use and if I’m
using the correct one then what is wrong with the code. Â Â Also, since
the user may be moving between memos I need to know which event to use for that
as well.

Â

I have it working fine when a user changes the CategoryID
(afterFieldChange), but it does not work when the memo is just displayed on the
screen.

Â

Â

This is the code that does not work. Â (just trying to
display the category for now)

Â

Private Sub MemoForm_Load(ByVal sender As object, ByVal args
As EventArgs) Handles MemoForm.Load

       '//

       '// Add Event
Handler Code

       '//

      Â

        dim edv as
EpiDataView = CType(oTrans.EpiDataViews("Memo"), EpiDataView)

Â

       try

          Â
dim strCategoryID as string = edv.dataView(edv.Row)("CategoryID")

         Â
messagebox.Show(strCategoryID)

       catch ex as
exception

          Â
messagebox.show(ex.message)

       end
try    Â

                      Â

        edv =
nothing

End SubÂ

Â

Â

Regards,

Linda

Â

</div>
 


<div style="color:rgb(255,255,255);"></div>

<p></p></div>
 


<div style="color:rgb(255,255,255);"></div>

</div>
 


<div style="color:rgb(255,255,255);"></div>

<p></p></div>
 


<div style="color:rgb(255,255,255);"></div>

</div>
 


<div style="color:rgb(255,255,255);"></div>

</div>
 


<div style="color:rgb(255,255,255);min-height:0px;"></div>

Hi Group,

Â

I want to create a customization that will set some user
fields visible or invisible depending on which Memo CategoryID is displayed on
the form. I tried using the Load event but it seems that no row is
available since I received the message Index -1 is either negative or above
rows count (I could be misunderstanding the error since I don’t know much about
vb.net.) Would someone please tell me which event I should use and if I’m
using the correct one then what is wrong with the code. Â Â Also, since
the user may be moving between memos I need to know which event to use for that
as well.

Â

I have it working fine when a user changes the CategoryID
(afterFieldChange), but it does not work when the memo is just displayed on the
screen.

Â

Â

This is the code that does not work. Â (just trying to
display the category for now)

Â

Private Sub MemoForm_Load(ByVal sender As object, ByVal args
As EventArgs) Handles MemoForm.Load

       '//

       '// Add Event
Handler Code

       '//

      Â

        dim edv as
EpiDataView = CType(oTrans.EpiDataViews(“Memo”), EpiDataView)

Â

       try

          Â
dim strCategoryID as string = edv.dataView(edv.Row)(“CategoryID”)

         Â
messagebox.Show(strCategoryID)

       catch ex as
exception

          Â
messagebox.show(ex.message)

       end
try    Â

                      Â

        edv =
nothing

End SubÂ

Â

Â

Regards,

Linda

Â

Try using the Notify -> Initialize event from the wizard. Jsut make sure that args.Row >= 0



Jose C Gomez
Software Engineer



T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com

     Â


Quis custodiet ipsos custodes?


On Thu, Oct 3, 2013 at 4:40 PM, Linda Lowney <pridesignslinda@...> wrote:

Â
<div>
  
  
  <p></p><div dir="ltr"><font color="#000000" face="Times New Roman" size="3">

Hi Group,

Â

I want to create a customization that will set some user
fields visible or invisible depending on which Memo CategoryID is displayed on
the form. I tried using the Load event but it seems that no row is
available since I received the message Index -1 is either negative or above
rows count (I could be misunderstanding the error since I don’t know much about
vb.net.) Would someone please tell me which event I should use and if I’m
using the correct one then what is wrong with the code. Â Â Also, since
the user may be moving between memos I need to know which event to use for that
as well.

Â

I have it working fine when a user changes the CategoryID
(afterFieldChange), but it does not work when the memo is just displayed on the
screen.

Â

Â

This is the code that does not work. Â (just trying to
display the category for now)

Â

Private Sub MemoForm_Load(ByVal sender As object, ByVal args
As EventArgs) Handles MemoForm.Load

       '//

       '// Add Event
Handler Code

       '//

      Â

        dim edv as
EpiDataView = CType(oTrans.EpiDataViews("Memo"), EpiDataView)

Â

       try

          Â
dim strCategoryID as string = edv.dataView(edv.Row)("CategoryID")

         Â
messagebox.Show(strCategoryID)

       catch ex as
exception

          Â
messagebox.show(ex.message)

       end
try    Â

                      Â

        edv =
nothing

End SubÂ

Â

Â

Regards,

Linda

Â

</div>
 


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

Hi Jose,
Â
Thank you for your response.  I opened memo entry and I clicked on various memos, but none of the message boxes popped up. Am I doing something wrong?
Â
Private Sub edvMemo_EpiViewNotification(view As EpiDataView, args As EpiNotifyArgs) ' Handles edvMemo.EpiViewNotification
        '// ** Argument Properties and Uses **
        '// view.dataView(args.Row)("[FieldName]")
        '// args.Row, args.Column, args.Sender, args.NotifyType
        '// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes

           messagebox.show("Notify")
           Select Case args.NotifyType
               case is = EpiTransaction.NotifyType.Initialize
                   messagebox.show("Initializing")
                   if (args.row >= 0) then
                       messagebox.show("row >= 0")
                   end if
               case is = EpiTransaction.NotifyType.AddRow
                If (args.Row > -1) Then
                     ' don't care about this one right now
                End If
            case else
                   messagebox.show("else statement")
            End Select
    End Sub
Â
Regards,
Linda
 Â


On Thu, Oct 3, 2013 at 4:42 PM, Jose Gomez <jose@...> wrote:

Â
<div>
  
  
  <p><div dir="ltr"><div class="ygrps-yiv-1072212100gmail_default" style="font-family:verdana, sans-serif;font-size:small;">Try using the Notify -&gt; Initialize event from the wizard. Jsut make sure that args.Row &gt;= 0</div></div><div class="ygrps-yiv-1072212100gmail_extra">



Jose C Gomez
Software Engineer



T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com

     Â


Quis custodiet ipsos custodes?


On Thu, Oct 3, 2013 at 4:40 PM, Linda Lowney <pridesignslinda@...> wrote:

Â
<div>
  
  
  <p></p><div dir="ltr"><font color="#000000" face="Times New Roman" size="3">

Hi Group,

Â

I want to create a customization that will set some user
fields visible or invisible depending on which Memo CategoryID is displayed on
the form. I tried using the Load event but it seems that no row is
available since I received the message Index -1 is either negative or above
rows count (I could be misunderstanding the error since I don’t know much about
vb.net.) Would someone please tell me which event I should use and if I’m
using the correct one then what is wrong with the code. Â Â Also, since
the user may be moving between memos I need to know which event to use for that
as well.

Â

I have it working fine when a user changes the CategoryID
(afterFieldChange), but it does not work when the memo is just displayed on the
screen.

Â

Â

This is the code that does not work. Â (just trying to
display the category for now)

Â

Private Sub MemoForm_Load(ByVal sender As object, ByVal args
As EventArgs) Handles MemoForm.Load

       '//

       '// Add Event
Handler Code

       '//

      Â

        dim edv as
EpiDataView = CType(oTrans.EpiDataViews("Memo"), EpiDataView)

Â

       try

          Â
dim strCategoryID as string = edv.dataView(edv.Row)("CategoryID")

         Â
messagebox.Show(strCategoryID)

       catch ex as
exception

          Â
messagebox.show(ex.message)

       end
try    Â

                      Â

        edv =
nothing

End SubÂ

Â

Â

Regards,

Linda

Â

</div>
 


<div style="color:rgb(255,255,255);"></div>

</div>
 


<div style="color:rgb(255,255,255);min-height:0px;"></div>

erm.. see what view those are tied to? That should work... What view are the boxes you are clicking linked to? Just remove all the IF THEN ELSE and  display a message box on notify period.


Jose C Gomez
Software Engineer


T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com

     Â


Quis custodiet ipsos custodes?


On Fri, Oct 4, 2013 at 10:39 AM, Linda Lowney <pridesignslinda@...> wrote:

Â
<div>
  
  
  <p></p><div dir="ltr"><div>Hi Jose,</div><div> </div><div>Thank you for your response.  I opened memo entry and I clicked on various memos, but none of the message boxes popped up.  Am I doing something wrong?</div>
Â
Private Sub edvMemo_EpiViewNotification(view As EpiDataView, args As EpiNotifyArgs) ' Handles edvMemo.EpiViewNotification
        '// ** Argument Properties and Uses **
        '// view.dataView(args.Row)("[FieldName]")

        '// args.Row, args.Column, args.Sender, args.NotifyType
        '// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes


           messagebox.show("Notify")
           Select Case args.NotifyType
               case is = EpiTransaction.NotifyType.Initialize
                   messagebox.show("Initializing")

                   if (args.row >= 0) then
                       messagebox.show("row >= 0")
                   end if
               case is = EpiTransaction.NotifyType.AddRow
                If (args.Row > -1) Then

                     ' don't care about this one right now
                End If
            case else
                   messagebox.show("else statement")
            End Select
    End Sub

Â
Regards,
Linda
 Â


On Thu, Oct 3, 2013 at 4:42 PM, Jose Gomez <jose@...> wrote:

Â
<div>
  
  
  <p></p><div dir="ltr"><div class="ygrps-yiv-373384852gmail_default" style="font-family:verdana, sans-serif;font-size:small;">Try using the Notify -&gt; Initialize event from the wizard. Jsut make sure that args.Row &gt;= 0</div></div><div class="ygrps-yiv-373384852gmail_extra">



Jose C Gomez
Software Engineer



T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com

     Â


Quis custodiet ipsos custodes?


On Thu, Oct 3, 2013 at 4:40 PM, Linda Lowney <pridesignslinda@...> wrote:

Â
<div>
  
  
  <p></p><div dir="ltr"><font color="#000000" face="Times New Roman" size="3">

Hi Group,

Â

I want to create a customization that will set some user
fields visible or invisible depending on which Memo CategoryID is displayed on
the form. I tried using the Load event but it seems that no row is
available since I received the message Index -1 is either negative or above
rows count (I could be misunderstanding the error since I don’t know much about
vb.net.) Would someone please tell me which event I should use and if I’m
using the correct one then what is wrong with the code. Â Â Also, since
the user may be moving between memos I need to know which event to use for that
as well.

Â

I have it working fine when a user changes the CategoryID
(afterFieldChange), but it does not work when the memo is just displayed on the
screen.

Â

Â

This is the code that does not work. Â (just trying to
display the category for now)

Â

Private Sub MemoForm_Load(ByVal sender As object, ByVal args
As EventArgs) Handles MemoForm.Load

       '//

       '// Add Event
Handler Code

       '//

      Â

        dim edv as
EpiDataView = CType(oTrans.EpiDataViews("Memo"), EpiDataView)

Â

       try

          Â
dim strCategoryID as string = edv.dataView(edv.Row)("CategoryID")

         Â
messagebox.Show(strCategoryID)

       catch ex as
exception

          Â
messagebox.show(ex.message)

       end
try    Â

                      Â

        edv =
nothing

End SubÂ

Â

Â

Regards,

Linda

Â

</div>
 


<div style="color:rgb(255,255,255);"></div>

<p></p></div>
 


<div style="color:rgb(255,255,255);"></div>

</div>
 


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

Hi Jose,
Â
When I open the Memo entry screen I get an error message (see below.)  Complete customization is below error message. Once I get past the error message it works great, I get my message popping up every time I expect it to so I guess it is stil related to there being no record when the form first loads. You said to make sure args was >= 0, but I'm not sure how I'm supposed to do that, since I'm not even sure what "args" is, lol.

Â

Â
Â

Error Detail

============

Exception has been
thrown by the target of an invocation.

Â

Â

Stack Trace

===========

  at
System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object arguments,
SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle
typeOwner)

  at
System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object arguments,
Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)

  at
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr,
Binder binder, Object parameters, CultureInfo culture, Boolean
skipVisibilityChecks)

  at
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr,
Binder binder, Object parameters, CultureInfo culture)

  at
Epicor.Mfg.UI.Customization.CustomScriptManager.OnCustomCodeFormLoad(Object
sender, EventArgs e)

Â

Inner Exception

===============

Unable to cast object of
type 'System.EventArgs' to type 'Epicor.Mfg.UI.FrameWork.EpiNotifyArgs'.

Â

Inner Stack Trace

=================

  at Script.MemoForm_Load(Object sender,
EventArgs args)

Â


Â

Here is the complete customization so far.


Â
'//
'// Custom VB.NET code for MemoForm
'// Created: 10/4/2013 11:27:11 AM
'//


Imports System
Imports System.Data
Imports System.Diagnostics
Imports System.Windows.Forms
Imports System.ComponentModel
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

Module Script
Â
 '// ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level Variables' Comments! **

 '// Begin Wizard Added Module Level Variables **
 Private WithEvents edvMemo As EpiDataView
 '// End Wizard Added Module Level Variables **Â
 '// Add Custom Module Level Variables Here **
 Sub InitializeCustomCode()
  '// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Intialization' lines **
  '// Begin Wizard Added Variable Intialization
  edvMemo = CType(oTrans.EpiDataViews("Memo"), EpiDataView)
  '// End Wizard Added Variable Intialization
      Â
  '// Begin Custom Method Calls
  '// End Custom Method Calls
 End Sub
 Sub DestroyCustomCode()
  '// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
  '// Begin Wizard Added Object Disposal
  edvMemo = Nothing
  '// End Wizard Added Object Disposal
  '// Begin Custom Code Disposal
  '// End Custom Code Disposal
 End Sub
 Private Sub MemoForm_Load(ByVal sender As object, ByVal args As EventArgs) Handles MemoForm.Load  Â
       edvMemo.notify(args)
  End Sub
 Private Sub edvMemo_EpiViewNotification(view As EpiDataView, args As EpiNotifyArgs) Handles edvMemo.EpiViewNotification
           messagebox.show("Notify event")    Â
   End Sub

End Module
Â
Â
Thanks again for all your help.
Â
Linda


On Fri, Oct 4, 2013 at 10:42 AM, Jose Gomez <jose@...> wrote:

Â
<div>
  
  
  <p><div dir="ltr"><div class="ygrps-yiv-1262067169gmail_default" style="font-family:verdana, sans-serif;font-size:small;">erm.. see what view those are tied to? That should work... What view are the boxes you are clicking linked to? Just remove all the IF THEN ELSE and  display a message box on notify period.</div>


Jose C Gomez
Software Engineer


T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com

     Â


Quis custodiet ipsos custodes?


On Fri, Oct 4, 2013 at 10:39 AM, Linda Lowney <pridesignslinda@...> wrote:

Â
<div>
  
  
  <p></p><div dir="ltr"><div>Hi Jose,</div><div> </div><div>Thank you for your response.  I opened memo entry and I clicked on various memos, but none of the message boxes popped up.  Am I doing something wrong?</div>
Â
Private Sub edvMemo_EpiViewNotification(view As EpiDataView, args As EpiNotifyArgs) ' Handles edvMemo.EpiViewNotification
        '// ** Argument Properties and Uses **
        '// view.dataView(args.Row)("[FieldName]")

        '// args.Row, args.Column, args.Sender, args.NotifyType
        '// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes


           messagebox.show("Notify")
           Select Case args.NotifyType
               case is = EpiTransaction.NotifyType.Initialize
                   messagebox.show("Initializing")

                   if (args.row >= 0) then
                       messagebox.show("row >= 0")
                   end if
               case is = EpiTransaction.NotifyType.AddRow
                If (args.Row > -1) Then

                     ' don't care about this one right now
                End If
            case else
                   messagebox.show("else statement")
            End Select
    End Sub

Â
Regards,
Linda
 Â


On Thu, Oct 3, 2013 at 4:42 PM, Jose Gomez <jose@...> wrote:

Â
<div>
  
  
  <p></p><div dir="ltr"><div class="ygrps-yiv-1262067169gmail_default" style="font-family:verdana, sans-serif;font-size:small;">Try using the Notify -&gt; Initialize event from the wizard. Jsut make sure that args.Row &gt;= 0</div></div><div class="ygrps-yiv-1262067169gmail_extra">



Jose C Gomez
Software Engineer



T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com

     Â


Quis custodiet ipsos custodes?


On Thu, Oct 3, 2013 at 4:40 PM, Linda Lowney <pridesignslinda@...> wrote:

Â
<div>
  
  
  <p></p><div dir="ltr"><font color="#000000" face="Times New Roman" size="3">

Hi Group,

Â

I want to create a customization that will set some user
fields visible or invisible depending on which Memo CategoryID is displayed on
the form. I tried using the Load event but it seems that no row is
available since I received the message Index -1 is either negative or above
rows count (I could be misunderstanding the error since I don’t know much about
vb.net.) Would someone please tell me which event I should use and if I’m
using the correct one then what is wrong with the code. Â Â Also, since
the user may be moving between memos I need to know which event to use for that
as well.

Â

I have it working fine when a user changes the CategoryID
(afterFieldChange), but it does not work when the memo is just displayed on the
screen.

Â

Â

This is the code that does not work. Â (just trying to
display the category for now)

Â

Private Sub MemoForm_Load(ByVal sender As object, ByVal args
As EventArgs) Handles MemoForm.Load

       '//

       '// Add Event
Handler Code

       '//

      Â

        dim edv as
EpiDataView = CType(oTrans.EpiDataViews("Memo"), EpiDataView)

Â

       try

          Â
dim strCategoryID as string = edv.dataView(edv.Row)("CategoryID")

         Â
messagebox.Show(strCategoryID)

       catch ex as
exception

          Â
messagebox.show(ex.message)

       end
try    Â

                      Â

        edv =
nothing

End SubÂ

Â

Â

Regards,

Linda

Â

</div>
 


<div style="color:rgb(255,255,255);"></div>

<p></p></div>
 


<div style="color:rgb(255,255,255);"></div>

</div>
 


<div style="color:rgb(255,255,255);"></div>

</div>
 


<div style="color:rgb(255,255,255);min-height:0px;"></div>

remove the stuff from form load... there is no Args in form load that's where your error comes from.



Jose C Gomez
Software Engineer



T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com

     Â


Quis custodiet ipsos custodes?


On Fri, Oct 4, 2013 at 12:13 PM, Linda Lowney <pridesignslinda@...> wrote:

Â
<div>
  
  
  <p></p><div dir="ltr"><div>Hi Jose,</div><div> </div><div>When I open the Memo entry screen I get an error message (see below.)  Complete customization is below error message. Once I get past the error message it works great, I get <font color="#000000" face="Times New Roman" size="3"><font face="Arial"><font color="#222222">my message popping up every time I expect it to so I guess it is stil related to there being no record when the form first loads.  You said to make sure args was &gt;= 0, but I&#39;m not sure how I&#39;m supposed to do that, since I&#39;m not even sure what &quot;args&quot; is, lol.</font></font></font><p>

Â

Â
Â

Error Detail

============

Exception has been
thrown by the target of an invocation.

Â

Â

Stack Trace

===========

  at
System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object arguments,
SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle
typeOwner)

  at
System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object arguments,
Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)

  at
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr,
Binder binder, Object parameters, CultureInfo culture, Boolean
skipVisibilityChecks)

  at
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr,
Binder binder, Object parameters, CultureInfo culture)

  at
Epicor.Mfg.UI.Customization.CustomScriptManager.OnCustomCodeFormLoad(Object
sender, EventArgs e)

Â

Inner Exception

===============

Unable to cast object of
type 'System.EventArgs' to type 'Epicor.Mfg.UI.FrameWork.EpiNotifyArgs'.

Â

Inner Stack Trace

=================

  at Script.MemoForm_Load(Object sender,
EventArgs args)

Â


Â

Here is the complete customization so far.


Â
'//**************************************************
'// Custom VB.NET code for MemoForm
'// Created: 10/4/2013 11:27:11 AM

'//**************************************************

Imports System
Imports System.Data
Imports System.Diagnostics
Imports System.Windows.Forms
Imports System.ComponentModel
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

Module Script
Â
 '// ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level Variables' Comments! **

 '// Begin Wizard Added Module Level Variables **
 Private WithEvents edvMemo As EpiDataView
 '// End Wizard Added Module Level Variables **Â
 '// Add Custom Module Level Variables Here **
 Sub InitializeCustomCode()
  '// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Intialization' lines **

  '// Begin Wizard Added Variable Intialization
  edvMemo = CType(oTrans.EpiDataViews("Memo"), EpiDataView)
  '// End Wizard Added Variable Intialization
      Â
  '// Begin Custom Method Calls

  '// End Custom Method Calls
 End Sub

 Sub DestroyCustomCode()
  '// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
  '// Begin Wizard Added Object Disposal

  edvMemo = Nothing
  '// End Wizard Added Object Disposal
  '// Begin Custom Code Disposal

  '// End Custom Code Disposal
 End Sub
 Private Sub MemoForm_Load(ByVal sender As object, ByVal args As EventArgs) Handles MemoForm.Load  Â

       edvMemo.notify(args)
  End Sub
 Private Sub edvMemo_EpiViewNotification(view As EpiDataView, args As EpiNotifyArgs) Handles edvMemo.EpiViewNotification
           messagebox.show("Notify event")    Â

   End Sub


End Module
Â
Â
Thanks again for all your help.
Â
Linda


On Fri, Oct 4, 2013 at 10:42 AM, Jose Gomez <jose@…> wrote:

Â
<div>
  
  
  <p></p><div dir="ltr"><div class="ygrps-yiv-1528847760gmail_default" style="font-family:verdana, sans-serif;font-size:small;">erm.. see what view those are tied to? That should work... What view are the boxes you are clicking linked to? Just remove all the IF THEN ELSE and  display a message box on notify period.</div>


Jose C Gomez
Software Engineer


T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com

     Â


Quis custodiet ipsos custodes?


On Fri, Oct 4, 2013 at 10:39 AM, Linda Lowney <pridesignslinda@...> wrote:

Â
<div>
  
  
  <p></p><div dir="ltr"><div>Hi Jose,</div><div> </div><div>Thank you for your response.  I opened memo entry and I clicked on various memos, but none of the message boxes popped up.  Am I doing something wrong?</div>
Â
Private Sub edvMemo_EpiViewNotification(view As EpiDataView, args As EpiNotifyArgs) ' Handles edvMemo.EpiViewNotification
        '// ** Argument Properties and Uses **
        '// view.dataView(args.Row)("[FieldName]")

        '// args.Row, args.Column, args.Sender, args.NotifyType
        '// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes


           messagebox.show("Notify")
           Select Case args.NotifyType
               case is = EpiTransaction.NotifyType.Initialize
                   messagebox.show("Initializing")

                   if (args.row >= 0) then
                       messagebox.show("row >= 0")
                   end if
               case is = EpiTransaction.NotifyType.AddRow
                If (args.Row > -1) Then

                     ' don't care about this one right now
                End If
            case else
                   messagebox.show("else statement")
            End Select
    End Sub

Â
Regards,
Linda
 Â


On Thu, Oct 3, 2013 at 4:42 PM, Jose Gomez <jose@...> wrote:

Â
<div>
  
  
  <p></p><div dir="ltr"><div class="ygrps-yiv-1528847760gmail_default" style="font-family:verdana, sans-serif;font-size:small;">Try using the Notify -&gt; Initialize event from the wizard. Jsut make sure that args.Row &gt;= 0</div></div><div class="ygrps-yiv-1528847760gmail_extra">



Jose C Gomez
Software Engineer



T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com

     Â


Quis custodiet ipsos custodes?


On Thu, Oct 3, 2013 at 4:40 PM, Linda Lowney <pridesignslinda@...> wrote:

Â
<div>
  
  
  <p></p><div dir="ltr"><font color="#000000" face="Times New Roman" size="3">

Hi Group,

Â

I want to create a customization that will set some user
fields visible or invisible depending on which Memo CategoryID is displayed on
the form. I tried using the Load event but it seems that no row is
available since I received the message Index -1 is either negative or above
rows count (I could be misunderstanding the error since I don’t know much about
vb.net.) Would someone please tell me which event I should use and if I’m
using the correct one then what is wrong with the code. Â Â Also, since
the user may be moving between memos I need to know which event to use for that
as well.

Â

I have it working fine when a user changes the CategoryID
(afterFieldChange), but it does not work when the memo is just displayed on the
screen.

Â

Â

This is the code that does not work. Â (just trying to
display the category for now)

Â

Private Sub MemoForm_Load(ByVal sender As object, ByVal args
As EventArgs) Handles MemoForm.Load

       '//

       '// Add Event
Handler Code

       '//

      Â

        dim edv as
EpiDataView = CType(oTrans.EpiDataViews("Memo"), EpiDataView)

Â

       try

          Â
dim strCategoryID as string = edv.dataView(edv.Row)("CategoryID")

         Â
messagebox.Show(strCategoryID)

       catch ex as
exception

          Â
messagebox.show(ex.message)

       end
try    Â

                      Â

        edv =
nothing

End SubÂ

Â

Â

Regards,

Linda

Â

</div>
 


<div style="color:rgb(255,255,255);"></div>

<p></p></div>
 


<div style="color:rgb(255,255,255);"></div>

</div>
 


<div style="color:rgb(255,255,255);"></div>

<p></p></div>
 


<div style="color:rgb(255,255,255);"></div>

</div>
 


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