Customization: Performing a Save on button click

Jose suggested:

> since the Update method its private you'll have to use Reflector
> to get at it.
> Include in your customization System.Reflection.
>
> Then do something like this (note I am writing this out of memory
> so the syntax may not be 100%)
> MethodInfo mi =
> typeof(Epicor.Mfg.UI.App.YourForm.Transaction).GetMethod("Update"),
> BindingFlags.NonPublic | BindingFlags.Instance);
> mi.Invoke(oTrans, new object[] { });
>

Since this was one of my older customizations, it was in VB and that translated to:

imports System.Reflection

...
...
...

Dim mi as System.Reflection.MethodInfo

'// Thanks to Jose Gomez for the Save code
mi = GetType(Epicor.Mfg.UI.App.SerialNumberAssignmentEntry.Transaction).GetMethod("Update", BindingFlags.NonPublic Or BindingFlags.Instance)

mi.Invoke(oTrans, new object() {})



This compiles and runs like a champ. Thanks Jose!

Mark W.
9.04

We have a button in Serial Number Asignment that prints serial number labels (just Shells out to an external program). This will print the labels but if the user forgets to save, they are never assigned. I'd like to force a save before the labels print. I've added the usual

oTrans.Update()

but I get this error:

Function Update() As Boolean' is not accessible in this context because it is 'Private'.

What handle can I use to execute the Update method on the main form? This should be simple but I'm just not thinking clearly today...

Thanks!!!

Mark W.
Mark
since the Update method its private you'll have to use Reflector to get at
it.
Include in your customization System.Reflection.

Then do something like this (note I am writing this out of memory so the
syntax may not be 100%)
MethodInfo mi =
typeof(Epicor.Mfg.UI.App.YourForm.Transaction).GetMethod("Update"),
BindingFlags.NonPublic | BindingFlags.Instance);
mi.Invoke(oTrans, new object[] { });


*Jose C Gomez*
*Software Engineer*
*
*
*
*T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com
<http://www.linkedin.com/in/josecgomez> <http://www.facebook.com/josegomez>
<http://www.google.com/profiles/jose.gomez> <http://www.twitter.com/joc85>
<http://www.josecgomez.com/professional-resume/>
<http://www.josecgomez.com/feed/>
<http://www.usdoingstuff.com>

*Quis custodiet ipsos custodes?*


On Thu, Feb 14, 2013 at 1:38 PM, Mark <mark_wonsil@...> wrote:

> **
>
>
>
> 9.04
>
> We have a button in Serial Number Asignment that prints serial number
> labels (just Shells out to an external program). This will print the labels
> but if the user forgets to save, they are never assigned. I'd like to force
> a save before the labels print. I've added the usual
>
> oTrans.Update()
>
> but I get this error:
>
> Function Update() As Boolean' is not accessible in this context because it
> is 'Private'.
>
> What handle can I use to execute the Update method on the main form? This
> should be simple but I'm just not thinking clearly today...
>
> Thanks!!!
>
> Mark W.
>
>
>


[Non-text portions of this message have been removed]