I agree, the dataview having no data is probably causing the issue. I initially looked to use the AfterAdapterMethod, but did not have the Part Plant adapter available. It looks like it is going to take a BPM to get this to work.
Bruce Butler, IS Manager
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of bw2868bond
Sent: Monday, November 28, 2011 1:05 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Customization Error-"Exception has been thrown by the target of an invocation."
And the dataview has no data in the form load event. You need to move your value assignment code to a dataview event
Bruce Butler, IS Manager
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of bw2868bond
Sent: Monday, November 28, 2011 1:05 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Customization Error-"Exception has been thrown by the target of an invocation."
And the dataview has no data in the form load event. You need to move your value assignment code to a dataview event
--- In vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>, Jose Gomez <jose@...> wrote:
>
> Also, I am not sure if oTrans has been initialized in Form Load try putting
> that in InitCustomCode.
>
> *Jose C Gomez*
> *Software Engineer*
> *
> *
> *checkout my new blog <http://www.usdoingstuff.com> *
> *
> *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 Mon, Nov 28, 2011 at 2:01 PM, Jose Gomez <jose@...> wrote:
>
> > PartPlant data view may not exists, what Form are you using it"?
> >
> > *Jose C Gomez*
> > *Software Engineer*
> > *
> > *
> > *checkout my new blog <http://www.usdoingstuff.com> *
> > *
> > *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 Mon, Nov 28, 2011 at 1:53 PM, Butler, Bruce <bbutler@...> wrote:
> >
> >> **
> >>
> >>
> >> I am getting an "Exception has been thrown by the target of an
> >> invocation." Error message due to the line in the code below that contains:
> >> DVPlantInfo.dataView(DVPlantInfo.Row)("LeadTime").
> >>
> >> If I comment this section out and simply put '=0' the code works. Any
> >> ideas?
> >>
> >> Private Sub PartForm_Load(ByVal sender As object, ByVal args As
> >> EventArgs) Handles PartForm.Load
> >> Dim DVPlantInfo As EpiDataView = CType(oTrans.EpiDataViews("PartPlant"),
> >> EpiDataView)
> >>
> >> '// BB-when I comment out the remaining line past the '=' below the
> >> "invocation error goes away"
> >> Dim LTime As Int32 = DVPlantInfo.dataView(DVPlantInfo.Row)("LeadTime")
> >>
> >> If LTime = 0 Then lblDaysOut.text = "Check LT" Else lblDaysOut.text
> >> =(DateAdd("h", -24, DateAdd("d", LTime, DateValue(Now))))
> >> End Sub
> >>
> >> Thank you,
> >>
> >> Bruce B.
> >>
> >> [Non-text portions of this message have been removed]
> >>
> >>
> >>
> >
> >
>
>
> [Non-text portions of this message have been removed]
>
[Non-text portions of this message have been removed]