Customization to display a part picture

In the script editor, move the 'Imports System.IO' statement up to
near beginning of the code where you will see other import statements.
This should fix the 'file' not declared error. System.io has the
definition for 'file' in it.


Jim Kinneman
En>compass Solutions Inc.
Tel 336.207.7166
Fax 336.217.7983
E-mail jimki@...
www.encompass-inc.com

--- In vantage@yahoogroups.com, "homestyleindustries"
<homestyleindustries@...> wrote:
>
> Ed,
>
> I tried to use the code you inserted into your last message and am
> getting an error with the "File.Exists(vPartPic)" part. I get an
> error that says "Name 'file' is not declared". What is it? Plus I
> get another error that states "'Imports' statements must precede any
> declarations". Do you know what I need to do to fix these?
>
>
> --- In vantage@yahoogroups.com, Ed Garbowski <egarbowski@> wrote:
> >
> > I'm pretty new to this, but I'll share what worked for me. Through
> the Script Editor, the main code is in a 'Private Sub' after the
> 'DestroyCustomCode' sub, but I also added a check to verify the file
> exists prior to displaying the picture. You can lock up Vantage if it
> cannot find the file. The 'NotAvail.jpg' is just a jpg with text
> saying 'Picture Not Available'.
> >
> > Here's a copy of the code I'm using, after stripping out a bunch of
> other stuff unrelated to displaying the picture. You'd have to modify
> the 'filepath' and possibly the PartNum native control reference to
> work with your customization:
> >
> > ___________________________________________
> > Imports System.IO
> >
> > Private WithEvents edvPart As EpiDataView
> >
> > Dim PartField as EpiTextBox
> >
> > Dim vPartNum as string
> >
> > Dim vPartPic as string
> >
> > Sub InitializeCustomCode()
> > edvPart = CType(oTrans.EpiDataViews("Part"),
> EpiDataView)
> > End Sub
> >
> > Private Sub edvPart_EpiViewNotification(view As EpiDataView, args As
> EpiNotifyArgs) Handles edvPart.EpiViewNotification
> > If (args.NotifyType = EpiTransaction.NotifyType.Initialize) Then
> > If (args.Row > -1) Then
> > PartField =
> Ctype(csm.GetNativeControlReference("38e1671b-0c3f-4ab3-b8ab-
> 95f26285f1d2"),EpiTextBox)
> > vPartNum = PartField.Text
> > '// Display part picture
> > vPartPic = "\\'filepath'\" + vPartNum + ".jpg"
> > If File.Exists(vPartPic) Then
> > picEpiCustom3.Image = System.Drawing.Image.FromFile(vPartPic)
> > Else
> > picEpiCustom3.Image =
> System.Drawing.Image.FromFile("\\'filepath'\NotAvail.jpg")
> > End If
> > End If
> > End If
> > End Sub
> > _______________________________________
> >
> > Thanks,
> > Ed
> > From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On
> Behalf Of Brian Stenglein
> > Sent: Tuesday, November 11, 2008 8:39 AM
> > To: vantage@yahoogroups.com
> > Subject: [Vantage] Re: Customization to display a part picture
> >
> >
> > Pardon me for jumping in, but where does that code go?
> >
> > Brian Stenglein
> >
> > --- In vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>,
> "Daniel Laidig" <daniellaidig@>
> > wrote:
> > >
> > > Use picturebox found in the Epicor ToolBox set. The code to attach
> > an image
> > > the placed picturebox is:
> > >
> > >
> > >
> > > picEpiCustom1.Image = System.Drawing.Image.FromFile(FileName)
> > >
> > >
> > >
> > > Hope this help.
> > >
> > > Daniel Laidig
> > >
> > >
> > >
> > > From: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>
> [mailto:vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>] On
> > Behalf Of
> > > Ed Garbowski
> > > Sent: Monday, November 10, 2008 12:25 PM
> > > To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>
> > > Subject: [Vantage] Customization to display a part picture
> > >
> > >
> > >
> > > Does anyone have an example of a customization to display a
> picture
> > for
> > > a part in the Part Tracker and Part Entry? We'd like to store jpgs
> > of
> > > our parts using a 'PartNum'.jpg format and show the picture just
> > like
> > > the employee photo is viewed in Payroll Employee Maintenance. Any
> > > direction is much appreciated.
> > > Thanks,
> > > Ed
> > >
> > >
> > >
> > >
> > >
> > > [Non-text portions of this message have been removed]
> > >
> >
> >
> > ________________________________
> > The information contained in this message is intended solely for the
> individual to whom it is specifically and originally addressed. This
> message and its contents may contain confidential or privileged
> information. If you are not the intended recipient, you are hereby
> notified that any disclosure or distribution, or taking any action in
> reliance on the contents of this information, is strictly prohibited.
> > We have taken precautions to minimize the risk of transmitting
> software viruses, but we advise you to carry out your own virus checks
> on any attachment to this message. We cannot accept liability for any
> loss or damage caused by software viruses.
> >
> > This message (including any attachments) is intended only for
> > the use of the individual or entity to which it is addressed and
> > may contain information that is non-public, proprietary,
> > privileged, confidential, and exempt from disclosure under
> > applicable law or may constitute as attorney work product.
> > If you are not the intended recipient, you are hereby notified
> > that any use, dissemination, distribution, or copying of this
> > communication is strictly prohibited. If you have received this
> > communication in error, notify us immediately by telephone and
> > (i) destroy this message if a facsimile or (ii) delete this message
> > immediately if this is an electronic communication.
> >
> > Thank you.
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
Does anyone have an example of a customization to display a picture for
a part in the Part Tracker and Part Entry? We'd like to store jpgs of
our parts using a 'PartNum'.jpg format and show the picture just like
the employee photo is viewed in Payroll Employee Maintenance. Any
direction is much appreciated.
Thanks,
Ed
This exact topic was covered in the Advanced Customization training
class in Las Vegas. I don't see the presentation/Lab for this class
online or on the USB drive they gave us, but I have the book at home. I
can bring it in tomorrow and send you a summary.



-brian



--

Brian W. Spolarich ~ Manager, Information Services ~ Advanced Photonix /
Picometrix

bspolarich@... ~ 734-864-5618 ~
www.advancedphotonix.com



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Ed Garbowski
Sent: Monday, November 10, 2008 12:25 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Customization to display a part picture



Does anyone have an example of a customization to display a picture for
a part in the Part Tracker and Part Entry? We'd like to store jpgs of
our parts using a 'PartNum'.jpg format and show the picture just like
the employee photo is viewed in Payroll Employee Maintenance. Any
direction is much appreciated.
Thanks,
Ed





[Non-text portions of this message have been removed]
Use picturebox found in the Epicor ToolBox set. The code to attach an image
the placed picturebox is:



picEpiCustom1.Image = System.Drawing.Image.FromFile(FileName)



Hope this help.

Daniel Laidig



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
Ed Garbowski
Sent: Monday, November 10, 2008 12:25 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Customization to display a part picture



Does anyone have an example of a customization to display a picture for
a part in the Part Tracker and Part Entry? We'd like to store jpgs of
our parts using a 'PartNum'.jpg format and show the picture just like
the employee photo is viewed in Payroll Employee Maintenance. Any
direction is much appreciated.
Thanks,
Ed





[Non-text portions of this message have been removed]
Thanks. That worked perfectly.
Ed
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Daniel Laidig
Sent: Monday, November 10, 2008 11:57 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Customization to display a part picture


Use picturebox found in the Epicor ToolBox set. The code to attach an image
the placed picturebox is:

picEpiCustom1.Image = System.Drawing.Image.FromFile(FileName)

Hope this help.

Daniel Laidig

From: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> [mailto:vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>] On Behalf Of
Ed Garbowski
Sent: Monday, November 10, 2008 12:25 PM
To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>
Subject: [Vantage] Customization to display a part picture

Does anyone have an example of a customization to display a picture for
a part in the Part Tracker and Part Entry? We'd like to store jpgs of
our parts using a 'PartNum'.jpg format and show the picture just like
the employee photo is viewed in Payroll Employee Maintenance. Any
direction is much appreciated.
Thanks,
Ed

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


________________________________
The information contained in this message is intended solely for the individual to whom it is specifically and originally addressed. This message and its contents may contain confidential or privileged information. If you are not the intended recipient, you are hereby notified that any disclosure or distribution, or taking any action in reliance on the contents of this information, is strictly prohibited.
We have taken precautions to minimize the risk of transmitting software viruses, but we advise you to carry out your own virus checks on any attachment to this message. We cannot accept liability for any loss or damage caused by software viruses.

This message (including any attachments) is intended only for
the use of the individual or entity to which it is addressed and
may contain information that is non-public, proprietary,
privileged, confidential, and exempt from disclosure under
applicable law or may constitute as attorney work product.
If you are not the intended recipient, you are hereby notified
that any use, dissemination, distribution, or copying of this
communication is strictly prohibited. If you have received this
communication in error, notify us immediately by telephone and
(i) destroy this message if a facsimile or (ii) delete this message
immediately if this is an electronic communication.

Thank you.


[Non-text portions of this message have been removed]
Pardon me for jumping in, but where does that code go?

Brian Stenglein

--- In vantage@yahoogroups.com, "Daniel Laidig" <daniellaidig@...>
wrote:
>
> Use picturebox found in the Epicor ToolBox set. The code to attach
an image
> the placed picturebox is:
>
>
>
> picEpiCustom1.Image = System.Drawing.Image.FromFile(FileName)
>
>
>
> Hope this help.
>
> Daniel Laidig
>
>
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On
Behalf Of
> Ed Garbowski
> Sent: Monday, November 10, 2008 12:25 PM
> To: vantage@yahoogroups.com
> Subject: [Vantage] Customization to display a part picture
>
>
>
> Does anyone have an example of a customization to display a picture
for
> a part in the Part Tracker and Part Entry? We'd like to store jpgs
of
> our parts using a 'PartNum'.jpg format and show the picture just
like
> the employee photo is viewed in Payroll Employee Maintenance. Any
> direction is much appreciated.
> Thanks,
> Ed
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
I'm pretty new to this, but I'll share what worked for me. Through the Script Editor, the main code is in a 'Private Sub' after the 'DestroyCustomCode' sub, but I also added a check to verify the file exists prior to displaying the picture. You can lock up Vantage if it cannot find the file. The 'NotAvail.jpg' is just a jpg with text saying 'Picture Not Available'.

Here's a copy of the code I'm using, after stripping out a bunch of other stuff unrelated to displaying the picture. You'd have to modify the 'filepath' and possibly the PartNum native control reference to work with your customization:

___________________________________________
Imports System.IO

Private WithEvents edvPart As EpiDataView

Dim PartField as EpiTextBox

Dim vPartNum as string

Dim vPartPic as string

Sub InitializeCustomCode()
edvPart = CType(oTrans.EpiDataViews("Part"), EpiDataView)
End Sub

Private Sub edvPart_EpiViewNotification(view As EpiDataView, args As EpiNotifyArgs) Handles edvPart.EpiViewNotification
If (args.NotifyType = EpiTransaction.NotifyType.Initialize) Then
If (args.Row > -1) Then
PartField = Ctype(csm.GetNativeControlReference("38e1671b-0c3f-4ab3-b8ab-95f26285f1d2"),EpiTextBox)
vPartNum = PartField.Text
'// Display part picture
vPartPic = "\\'filepath'\" + vPartNum + ".jpg"
If File.Exists(vPartPic) Then
picEpiCustom3.Image = System.Drawing.Image.FromFile(vPartPic)
Else
picEpiCustom3.Image = System.Drawing.Image.FromFile("\\'filepath'\NotAvail.jpg")
End If
End If
End If
End Sub
_______________________________________

Thanks,
Ed
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Brian Stenglein
Sent: Tuesday, November 11, 2008 8:39 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Customization to display a part picture


Pardon me for jumping in, but where does that code go?

Brian Stenglein

--- In vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>, "Daniel Laidig" <daniellaidig@...>
wrote:
>
> Use picturebox found in the Epicor ToolBox set. The code to attach
an image
> the placed picturebox is:
>
>
>
> picEpiCustom1.Image = System.Drawing.Image.FromFile(FileName)
>
>
>
> Hope this help.
>
> Daniel Laidig
>
>
>
> From: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> [mailto:vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>] On
Behalf Of
> Ed Garbowski
> Sent: Monday, November 10, 2008 12:25 PM
> To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>
> Subject: [Vantage] Customization to display a part picture
>
>
>
> Does anyone have an example of a customization to display a picture
for
> a part in the Part Tracker and Part Entry? We'd like to store jpgs
of
> our parts using a 'PartNum'.jpg format and show the picture just
like
> the employee photo is viewed in Payroll Employee Maintenance. Any
> direction is much appreciated.
> Thanks,
> Ed
>
>
>
>
>
> [Non-text portions of this message have been removed]
>


________________________________
The information contained in this message is intended solely for the individual to whom it is specifically and originally addressed. This message and its contents may contain confidential or privileged information. If you are not the intended recipient, you are hereby notified that any disclosure or distribution, or taking any action in reliance on the contents of this information, is strictly prohibited.
We have taken precautions to minimize the risk of transmitting software viruses, but we advise you to carry out your own virus checks on any attachment to this message. We cannot accept liability for any loss or damage caused by software viruses.

This message (including any attachments) is intended only for
the use of the individual or entity to which it is addressed and
may contain information that is non-public, proprietary,
privileged, confidential, and exempt from disclosure under
applicable law or may constitute as attorney work product.
If you are not the intended recipient, you are hereby notified
that any use, dissemination, distribution, or copying of this
communication is strictly prohibited. If you have received this
communication in error, notify us immediately by telephone and
(i) destroy this message if a facsimile or (ii) delete this message
immediately if this is an electronic communication.

Thank you.


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

I tried to use the code you inserted into your last message and am
getting an error with the "File.Exists(vPartPic)" part. I get an
error that says "Name 'file' is not declared". What is it? Plus I
get another error that states "'Imports' statements must precede any
declarations". Do you know what I need to do to fix these?


--- In vantage@yahoogroups.com, Ed Garbowski <egarbowski@...> wrote:
>
> I'm pretty new to this, but I'll share what worked for me. Through
the Script Editor, the main code is in a 'Private Sub' after the
'DestroyCustomCode' sub, but I also added a check to verify the file
exists prior to displaying the picture. You can lock up Vantage if it
cannot find the file. The 'NotAvail.jpg' is just a jpg with text
saying 'Picture Not Available'.
>
> Here's a copy of the code I'm using, after stripping out a bunch of
other stuff unrelated to displaying the picture. You'd have to modify
the 'filepath' and possibly the PartNum native control reference to
work with your customization:
>
> ___________________________________________
> Imports System.IO
>
> Private WithEvents edvPart As EpiDataView
>
> Dim PartField as EpiTextBox
>
> Dim vPartNum as string
>
> Dim vPartPic as string
>
> Sub InitializeCustomCode()
> edvPart = CType(oTrans.EpiDataViews("Part"),
EpiDataView)
> End Sub
>
> Private Sub edvPart_EpiViewNotification(view As EpiDataView, args As
EpiNotifyArgs) Handles edvPart.EpiViewNotification
> If (args.NotifyType = EpiTransaction.NotifyType.Initialize) Then
> If (args.Row > -1) Then
> PartField =
Ctype(csm.GetNativeControlReference("38e1671b-0c3f-4ab3-b8ab-
95f26285f1d2"),EpiTextBox)
> vPartNum = PartField.Text
> '// Display part picture
> vPartPic = "\\'filepath'\" + vPartNum + ".jpg"
> If File.Exists(vPartPic) Then
> picEpiCustom3.Image = System.Drawing.Image.FromFile(vPartPic)
> Else
> picEpiCustom3.Image =
System.Drawing.Image.FromFile("\\'filepath'\NotAvail.jpg")
> End If
> End If
> End If
> End Sub
> _______________________________________
>
> Thanks,
> Ed
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On
Behalf Of Brian Stenglein
> Sent: Tuesday, November 11, 2008 8:39 AM
> To: vantage@yahoogroups.com
> Subject: [Vantage] Re: Customization to display a part picture
>
>
> Pardon me for jumping in, but where does that code go?
>
> Brian Stenglein
>
> --- In vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>,
"Daniel Laidig" <daniellaidig@>
> wrote:
> >
> > Use picturebox found in the Epicor ToolBox set. The code to attach
> an image
> > the placed picturebox is:
> >
> >
> >
> > picEpiCustom1.Image = System.Drawing.Image.FromFile(FileName)
> >
> >
> >
> > Hope this help.
> >
> > Daniel Laidig
> >
> >
> >
> > From: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>] On
> Behalf Of
> > Ed Garbowski
> > Sent: Monday, November 10, 2008 12:25 PM
> > To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>
> > Subject: [Vantage] Customization to display a part picture
> >
> >
> >
> > Does anyone have an example of a customization to display a
picture
> for
> > a part in the Part Tracker and Part Entry? We'd like to store jpgs
> of
> > our parts using a 'PartNum'.jpg format and show the picture just
> like
> > the employee photo is viewed in Payroll Employee Maintenance. Any
> > direction is much appreciated.
> > Thanks,
> > Ed
> >
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
>
> ________________________________
> The information contained in this message is intended solely for the
individual to whom it is specifically and originally addressed. This
message and its contents may contain confidential or privileged
information. If you are not the intended recipient, you are hereby
notified that any disclosure or distribution, or taking any action in
reliance on the contents of this information, is strictly prohibited.
> We have taken precautions to minimize the risk of transmitting
software viruses, but we advise you to carry out your own virus checks
on any attachment to this message. We cannot accept liability for any
loss or damage caused by software viruses.
>
> This message (including any attachments) is intended only for
> the use of the individual or entity to which it is addressed and
> may contain information that is non-public, proprietary,
> privileged, confidential, and exempt from disclosure under
> applicable law or may constitute as attorney work product.
> If you are not the intended recipient, you are hereby notified
> that any use, dissemination, distribution, or copying of this
> communication is strictly prohibited. If you have received this
> communication in error, notify us immediately by telephone and
> (i) destroy this message if a facsimile or (ii) delete this message
> immediately if this is an electronic communication.
>
> Thank you.
>
>
> [Non-text portions of this message have been removed]
>