Here you go Mark.
At start of modulde declare:
Private withEvents edvJob As EpiDataView
In Sub InitializeCustomCode() -
edvJob = CType(oTrans.EpiDataViews( "JobHead" ), EpiDataView)
In Sub DestroyCustomCode() -
edvJob = Nothing
"txtEpiJobNum" is an invisible text box linked to JobHead.JobNum
"txtEpiPartDescr" is an invisible text box inked to JobHead.PartDescription
Private Sub txtEpiJobNum_TextChanged(ByVal Sender As Object, ByVal Args As System.EventArgs) Handles txtEpiJobNum.TextChanged
'// ** Place Event Handling Code Here **
If len(txtEpiJobNum.text) <> 0 then
'prevents row(-1) error on Empty form launch
If len(txtEpiPartDescr.text) <> 0 then
'assures minimal info is entered when creating
'a New Job before trying to lock job qty below.
'(Avoids an error that would otherwise occur.)
edvJob.dataview(edvJob.row)("LockedQty")= True
'Try it without the forced otrans.update() below 1st.
'Our Job Entry actually has 15 Subs, 11 Functions,
' 1 FKV and 2 SubTable added views.
'This Sub alone sets 7 table.field values based on
'numerous conditional tests.
'The interactions of all the customizations results
'in the need to force updates at specific points -
'or all table.fields fail to update as expected.
'For this simple single table.field update, you may
'not need to force it. Every otrans.update() results
'in the user experiencing an 'hour glass' during the
'temp dataset writes to the db - so avoid them where
' not really needed
otrans.update()
otrans.refresh()
'Let's the user see the change that was completed.
end if
end if
End Sub
Because we use Job Entry for three distinct processes, we have two
more Subs that do the same as above except they are triggered upon
Job Firming and upon Engineering a Job. (Using the same hidden
textbox _TextChanged event trigger paradigm on those two JobHead
fields.
Adapt your Sub event trigger(s) to what ever makes sense in your
processes.
Rob
At start of modulde declare:
Private withEvents edvJob As EpiDataView
In Sub InitializeCustomCode() -
edvJob = CType(oTrans.EpiDataViews( "JobHead" ), EpiDataView)
In Sub DestroyCustomCode() -
edvJob = Nothing
"txtEpiJobNum" is an invisible text box linked to JobHead.JobNum
"txtEpiPartDescr" is an invisible text box inked to JobHead.PartDescription
Private Sub txtEpiJobNum_TextChanged(ByVal Sender As Object, ByVal Args As System.EventArgs) Handles txtEpiJobNum.TextChanged
'// ** Place Event Handling Code Here **
If len(txtEpiJobNum.text) <> 0 then
'prevents row(-1) error on Empty form launch
If len(txtEpiPartDescr.text) <> 0 then
'assures minimal info is entered when creating
'a New Job before trying to lock job qty below.
'(Avoids an error that would otherwise occur.)
edvJob.dataview(edvJob.row)("LockedQty")= True
'Try it without the forced otrans.update() below 1st.
'Our Job Entry actually has 15 Subs, 11 Functions,
' 1 FKV and 2 SubTable added views.
'This Sub alone sets 7 table.field values based on
'numerous conditional tests.
'The interactions of all the customizations results
'in the need to force updates at specific points -
'or all table.fields fail to update as expected.
'For this simple single table.field update, you may
'not need to force it. Every otrans.update() results
'in the user experiencing an 'hour glass' during the
'temp dataset writes to the db - so avoid them where
' not really needed
otrans.update()
otrans.refresh()
'Let's the user see the change that was completed.
end if
end if
End Sub
Because we use Job Entry for three distinct processes, we have two
more Subs that do the same as above except they are triggered upon
Job Firming and upon Engineering a Job. (Using the same hidden
textbox _TextChanged event trigger paradigm on those two JobHead
fields.
Adapt your Sub event trigger(s) to what ever makes sense in your
processes.
Rob
--- On Fri, 12/5/08, Robert Brown <robertb_versa@...> wrote:
From: Robert Brown <robertb_versa@...>
Subject: Re: [Vantage] Re: Help With BAM Alert Program
To: vantage@yahoogroups.com
Date: Friday, December 5, 2008, 3:42 PM
Sure Mark. Nothing magical about it.
The biggest issue is for you to observe how your people process jobs so a reliable event trigger (or triggers) for your process can be monopolized.
We use several events triggers as we found certain types of jobs are processed differently than others.
Late in the day of a long week... Unless I get a chance over the weekend, it'll likely be Monday until I open app and email the code we use that pertains to this.
Rob
--- On Wed, 12/3/08, markewhittaker <markewhittaker@ yahoo.com> wrote:
From: markewhittaker <markewhittaker@ yahoo.com>
Subject: [Vantage] Re: Help With BAM Alert Program
To: vantage@yahoogroups .com
Date: Wednesday, December 3, 2008, 3:12 PM
Would you care to share your customization? I haven't tried it there
because I am more familiar with the 4gl environment than the .net
environment.
Thanks,
Mark
--- In vantage@yahoogroups .com, Robert Brown <robertb_versa@ ...>
wrote:
>
> We have a job entry customization that reliably locks qty (among
1/2 a dozen other things) on several hundred jobs a day as they are
created/reviewed.
>
> Find it hard to believe you can't do it via BPM. (We plan to move
this automation to BPM in fact... Just low priority so hasn't been
done yet.)
>
> Rob
>
> --- On Wed, 12/3/08, markewhittaker <markewhittaker@ ...> wrote:
>
> From: markewhittaker <markewhittaker@ ...>
> Subject: [Vantage] Re: Help With BAM Alert Program
> To: vantage@yahoogroups .com
> Date: Wednesday, December 3, 2008, 10:56 AM
>
>
>
>
>
>
> Well, I hit another snag. I am working on a bam that will
> automatically update a couple of things when a job is released. I
> want to add a person to jobhead.personlist and flag the quantity as
> being locked on that job. Updating jobhead.personlist works great,
> but I am having trouble with getting the quantity locked. It seems
> there is a little trickery here: Jobhead.lockqty does not do it.
> You can lock the quantity of a job in Vantage and jobhead.lockqty
is
> still set to No. The real culprit is comxref.foreignkey1 . When a
job
> is quantity locked, the related comxref record has foreignkey1 set
> to "YES". If I write a Progress program to find the comxref record
> and update foreignkey1 to "YES", the Quantity Lock flag on the Job
> Entry screen is checked. But I cannot get it to update using the
BAM
> alert program. I use this line of code in the bam alert:
>
> RUN lib/UpdateTableBuff er.r(input BUFFER
> Comxref:HANDLE, 'ForeignKey1' , "YES").
>
> That same format works fine for jobhead.personlist. I even put in
> some code in my bam program to find the comxref record and if it
was
> available change the jobhead.personlist value. It changed it, so I
> know the comxref record is available. Anyone have an idea why this
> would not work with the comxref table?
> --- In vantage@yahoogroups .com, "markewhittaker"
<markewhittaker@ ...>
> wrote:
> >
> > We have the ProVision license of Progress which allows you to
> compile
> > programs and write Progress apps that update data external to
> > Vantage. We mainly use it for converting data from other systems
> to
> > load into Vantage. Our company has 11 locations which are on
> > different erp systems and we are slowly migrating everyone to
> > Vantage. I originally compiled the bam program because I was
> getting
> > other errors and tried compiling to see if it worked.
> >
> > Anyway, you got me on the right track. I deleted the .r file and
> > made sure my bam called out the .p file, and it works!!! Our
> > ProVision license is for a different version of Progress, so I
> guess
> > when compiling a program it looks for triggers to match that
> version.
> >
> > Thanks for the help everyone!!
> > --- In vantage@yahoogroups .com, "Nigel Kerley" <nigel.kerley@ >
> > wrote:
> > >
> > > What do you mean when you say "compiles" and "re-compile" ? The
> > > license with the version of OpenEdge supplied with Vantage does
> not
> > > allow .p programs to be compiled, and for use with Alerts you
> don't
> > > need to compile them - I think they're compiled on the fly.
> > >
> > > According to the OpenEdge website, this error means that the
code
> > was
> > > compiled in a different version (of OpenEdge) than it is being
> run
> > in.
> > >
> > > My /ud folder has no .r files, only .p. Try deleting the .r
file
> > and
> > > see if that works.
> > >
> > > Alternatively, is there any chance that the
> lib\UpdateTableBuff er.p
> > > program got mixed up with a different version?
> > >
> > >
> > > Nigel.
> > >
> > >
> > > >
> > > > --- In vantage@yahoogroups .com, "markewhittaker"
> > <markewhittaker@ >
> > > > wrote:
> > > > >
> > > > > You are correct. This is the error:
> > > > >
> > > > > (Procedure: 'db/trg/jobhead/ WRITE.P' Line:5741) Invalid
> > version,
> > > > 1005
> > > > > (expected 17391) in object
> > > > >
> file /usr/epicor8/ mfgsys803/ Server/ud/ AssignPersonList ToJobs.r.
> > > > (2888)
> > > > >
> > > > > I am familiar with database triggers, but do not know what
> this
> > > > means.
> > > > >
> > > > > Anyone have an idea?
> > > > > --- In vantage@yahoogroups .com, "bw2868bond" <bwalker@>
wrote:
> > > > > >
> > > > > > There should be an error in the server log file that will
> > give
> > > > more
> > > > > > info
> > > > > >
> > > > > > --- In vantage@yahoogroups .com, "markewhittaker"
> > > > <markewhittaker@ >
> > > > > > wrote:
> > > > > > >
> > > > > > > Vantage 8.03.404A. I am trying to do my first alert
> > program
> > > on
> > > > a
> > > > > > > BAQ. I want to set JobHead.PersonList to "MWhittaker"
> > > whenever
> > > > a
> > > > > > job
> > > > > > > is released. I set up the BAM to alert only when
> > JobReleased
> > > =
> > > > > > > True. I tested the rules with an alert email and the
> rule
> > > > works
> > > > > as
> > > > > > I
> > > > > > > want. But when I add the alert program, I get an error,
> > even
> > > > > > though
> > > > > > > the program compiles without error. I can modify the
> > program
> > > > to
> > > > > > > comment out all the code (leaving a blank program) and
re-
> > > > compile
> > > > > > it,
> > > > > > > and I get the same error when I try to release a job
and
> > save
> > > > > it.
> > > > > > If
> > > > > > > I remove the alert program from the bam, I get the
> > > > alert.
> > > > > I
> > > > > > > have been reading links here and on Epicweb and Vantage
> > Help
> > > > > > Screens
> > > > > > > for clues on setting this up and I can't figure out
what
> I
> > am
> > > > > doing
> > > > > > > wrong. I hope someone here can help.
> > > > > > >
> > > > > > > Here is what I have set up.
> > > > > > >
> > > > > > > Alert Program: ud/AssignPersonList ToJobs.p
> > > > > > >
> > > > > > > This is the code in program ud/AssignPersonList
ToJobs.p:
> > > > > > >
> > > > > > > {ud/GlbAlert. i &TableName = "JobHead"}
> > > > > > > SendEmail = FALSE.
> > > > > > > RUN lib\UpdateTableBuff er.p(input BUFFER
> > > > > > > JobHead:HANDLE, 'PersonList' , "RPerry").
> > > > > > >
> > > > > > > This is the error I get when I release the job and
click
> > save:
> > > > > > >
> > > > > > > Error Detail
> > > > > > > ============
> > > > > > > 4GL STOP condition: The Server application has returned
> an
> > > > error.
> > > > > > > (7243) (7241)
> > > > > > >
> > > > > > >
> > > > > > > Stack Trace
> > > > > > > ===========
> > > > > > > at Progress.Open4GL. DynamicAPI. Session.runProce dure
> > (String
> > > > > > > requestID, String procedureName, ParameterSet parms,
> > Boolean
> > > > > > > persistent, Boolean internal_Renamed, Int64 procId,
> > > MetaSchema
> > > > > > > localSchema, Int32 stateModel)
> > > > > > > at
> > > Progress.Open4GL. DynamicAPI. Session.runState lessProcedure
> > > > > > > (String requestID, String fullProcedureName,
ParameterSet
> > > > > inparams,
> > > > > > > Object procId, MetaSchema localSchema, Int32 stateModel)
> > > > > > > at
> > > Progress.Open4GL. DynamicAPI. PersistentProc. runTheProcedure
> > > > > > > (String requestID, String procedureName, ParameterSet
> > parms,
> > > > > > > MetaSchema schema)
> > > > > > > at
> > Progress.Open4GL. DynamicAPI. PersistentProc. runProcedure
> > > > > > (String
> > > > > > > procedureName, ParameterSet parms, MetaSchema schema)
> > > > > > > at Epicor.Mfg.Proxy. JobEntryImpl. Update
> (JobEntryDataSet
> > ds)
> > > > > > > at Epicor.Mfg.UI. Adapters. JobEntryAdapter. Update()
> > > > > > > at Epicor.Mfg.UI. App.JobEntry. Transaction. Update()
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>