It's refreshing to see how active and willing to help this group is.
For the sake of where I'm at with my code, the suggestion Jose made was spot on. How the hell did I miss that? 1 measly line of code and I was good to go! Thank you very much!!!!
The other suggestions are great to. They give me new avenues to pursue in the event that this one doesn't pan out. I'm so new to Epicor that I don't even know the simple features that are built into the system to accomplish everyday tasks.
I'm a happy guy.. thanks again to all who chimed in!
For the sake of where I'm at with my code, the suggestion Jose made was spot on. How the hell did I miss that? 1 measly line of code and I was good to go! Thank you very much!!!!
The other suggestions are great to. They give me new avenues to pursue in the event that this one doesn't pan out. I'm so new to Epicor that I don't even know the simple features that are built into the system to accomplish everyday tasks.
I'm a happy guy.. thanks again to all who chimed in!
--- In vantage@yahoogroups.com, Jose Gomez <jose@...> wrote:
>
> The "Row" value of your priority dispatch table is not being set to 0 its
> at -1. Set PriorityDispatchParmsView.Row to 0 or simply use 0 instead to do
> it.
>
>
> *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 Fri, Apr 26, 2013 at 8:06 AM, jpkage79 <jpkage79@...> wrote:
>
> > **
> >
> >
> > Hello all,
> >
> > I'm new to the group and am excited that I found a group of folks
> > dedicated to working with Epicor. My general web searches do not return
> > much in the way of programming assistance/etc.
> >
> > On to my issue..
> >
> > I'm extremely new to the programming structure of Epicor so I've been
> > looking for examples on how people are adding custom print functionality to
> > existing forms. I'm working within the Epicor MES (9.0.5.700C)
> > customization screen.
> >
> > My goal seemed simple enough -- add a button that launches the Priority
> > Dispatch crystal report so our shop workers can see what job is next in
> > line. I'm having a miserable time getting it to work though.
> >
> > The code I managed to piece together from some talented folks in this
> > forum is below. I'm not sure if I'm using the wrong methods to attack this
> > or what! The code below compiles but when run it gives the following error:
> >
> > System.IndexOutOfRangeException: Index -1 is either negative or above rows
> > count.
> >
> > It fails right when it tries to add parameters to the dataset. I added all
> > of the parameters that I saw in the trace so there's likely way more than
> > there need to be.
> >
> > Hopefully it's something easy and someone can lend some help!
> >
> > Thanks
> >
> > ' **************************************************
> > ' Custom code for MESMenu
> > ' Created: 4/18/2013 11:29:33 AM
> > ' **************************************************
> > Imports System
> > Imports System.ComponentModel
> > Imports System.Data
> > Imports System.Diagnostics
> > Imports System.Windows.Forms
> > Imports System.Drawing
> > Imports System.Runtime.InteropServices
> > Imports Microsoft.VisualBasic
> > Imports Epicor.Mfg.BO
> > Imports Epicor.Mfg.UI
> > Imports Epicor.Mfg.UI.Adapters
> > Imports Epicor.Mfg.UI.Customization
> > Imports Epicor.Mfg.UI.ExtendedProps
> > Imports Epicor.Mfg.UI.FormFunctions
> > Imports Epicor.Mfg.UI.FrameWork
> > Imports Epicor.Mfg.UI.Searches
> > Imports Epicor.Mfg.BO.Reportmonitor
> > Imports Epicor.Mfg.Core.BLConnectionPool
> > Imports Epicor.Mfg.Core.Session
> > Imports Epicor.Mfg.Rpt.LPriorityDispatch
> > Imports Epicor.Mfg.Rpt.PriorityDispatch
> > Imports Epicor.Mfg.UIRpt.PriorityDispatch
> >
> > Public Class Script
> >
> > Private PrioDispAD As Epicor.Mfg.UI.Adapters.PriorityDispatchAdapter
> > Private PriorityDispatchParmsView As EpiDataView = new EpiDataView()
> >
> > Private Sub btnPD_Click(ByVal sender As Object, ByVal args As
> > System.EventArgs)
> >
> > Dim agentID as String
> > Dim agentSchedNum as Integer
> > Dim agentTaskNum as Integer
> > agentID = "SystemTaskAgent"
> >
> > Dim pd As System.Drawing.Printing.PrintDocument = new
> > System.Drawing.Printing.PrintDocument()
> >
> > PrioDispAD = new PriorityDispatchAdapter(otrans)
> > Try
> > PrioDispAD.BoConnect()
> > PriorityDispatchParmsView.dataView = new
> > DataView(PrioDispAD.ReportData.PriorityDispatchParam)
> > PrioDispAD.GetNewParameters()
> > Catch
> > End Try
> >
> > Try
> > PrioDispAD.GetNewParameters()
> >
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("Departments")
> > = ""
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("MaxNoOpr")
> > = "999"
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("OprCutoffDate")
> > = ""
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("NewPage")
> > = TRUE
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("OprCutoffDateToken")
> > =""
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("ResrceGrps")
> > ="1100VMC"
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("MtlStatus")
> > = FALSE
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("SumDtl")
> > = FALSE
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("PrintLbrRptRes")
> > = FALSE
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("ListAllSchedRes")
> > = FALSE
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("PrintTotals")
> > = FALSE
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("AutoAction")
> > ="Preview"
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("PrinterName")
> > =""
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("AgentSchedNum")
> > ="0"
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("AgentID")
> > ="SystemTaskAgent"
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("AgentTaskNum")
> > ="0"
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("RecurringTask")
> > = FALSE
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("RptPageSettings")
> > =""
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("RptPrinterSettings")
> > =""
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("RptVersion")
> > =""
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("ReportStyleNum")
> > ="1002"
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("WorkstationID")
> > ="INCOEDT087 1"
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("TaskNote")
> > =""
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("ArchiveCode")
> > ="0"
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("DateFormat")
> > ="m/d/yyyy"
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("NumericFormat")
> > =",."
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("AgentCompareString")
> > =""
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("ProcessID")
> > =""
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("ProcessTaskNum")
> > ="0"
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("DecimalsGeneral")
> > ="2"
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("DecimalsCost")
> > ="5"
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("DecimalsPrice")
> > ="5"
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("GlbDecimalsGeneral")
> > ="2"
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("GlbDecimalsCost")
> > ="5"
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("GlbDecimalsPrice")
> > ="5"
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("FaxSubject")
> > =""
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("FaxTo")
> > =""
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("FaxNumber")
> > =""
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("EMailTo")
> > =""
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("EMailCC")
> > =""
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("EMailBCC")
> > =""
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("EMailBody")
> > =""
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("AttachmentType")
> > =""
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("ReportCurrencyCode")
> > ="USD"
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("ReportCultureCode")
> > ="en-US"
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("RowIdent")
> > =""
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("RowMod")
> > ="A"
> > PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("DBRowIdent")
> > =""
> >
> > agentSchedNum =
> > CInt(PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("AgentSchedNum").ToString())
> > agentTaskNum =
> > CInt(PriorityDispatchParmsView.dataView(PriorityDispatchParmsView.Row)("AgentTaskNum").ToString())
> >
> >
> > PrioDispAD.SubmitToAgent(AgentID,0,0)
> > PriorityDispatchParmsView.Dispose()
> > PrioDispAD=Nothing
> > Catch ex as Exception
> > MessageBox.Show(ex.toString(),"ERROR")
> > End Try
> > End Sub
> > End Class
> >
> >
> >
>
>
> [Non-text portions of this message have been removed]
>