I happened to do that in a vb customization, though a BPM would be
easier... here is the logic I used in that script, it could help you in
formulating your BPM. Ill also attach code I used to prevent an user
from logging into an operation that is already completed (we often had
them log in, make parts because they managed to get a hold of a
duplicate traveler or what have you) and wed have an over production
situation. Since the discipline to log in was there, this has greatly
reduced if not eliminated that problem altogether. You could use that
code to build from. It will be the same bo/method in either case.
n Prevent user from over reporting on end activity (hide the original
vantage OK button and substitute your own)
Private Sub btnOK2_Click(ByVal Sender As Object, ByVal Args As
System.EventArgs) Handles btnOK2.Click
Dim edvSPA As EpiDataView =
CType(oTrans.EpiDataViews("End"), EpiDataView)
Dim vLtype As String =
edvSPA.dataView(edvSpa.row)("LaborType")
if vLtype = "P" Then
GetQtyCmplt()
End If
btnOK.PerformClick()
End Sub
Private Sub GetQtyCmplt()
'// ** Place Event Handling Code Here **
Dim edvSPA As EpiDataView =
CType(oTrans.EpiDataViews("End"), EpiDataView)
Dim nbrQty As EpiNumericEditor =
ctype(csm.GetNativeControlReference("f1fdcf24-066d-424e-9b59-319a804854f
a"),EpiNumericEditor)
Dim Qty As String = nbrQty.value
Dim vLqty As Decimal =
edvSPA.dataView(edvSpa.row)("LaborQty")
Dim vJob As String = edvSPA.dataView(edvSpa.Row)("JobNum")
Dim vAssy As String =
edvSPA.dataView(edvSpa.Row)("AssemblySeq")
Dim vOper As String = edvSPA.dataView(edvSpa.Row)("OprSeq")
Dim Total as Integer = 0
Dim adpJO As JobOperSearchAdapter = New
JobOperSearchAdapter(EndActForm)
adpJO.BOConnect()
Dim record As Boolean = adpJO.GetByID(vJob, vAssy, vOper)
Dim dsJO As JobOperSearchDataSet = adpJO.JobOperSearchData
Dim vQreq as Integer = dsJO.Tables
("JobOper").Rows(0)("RunQty")
Dim vQcmplt as Integer = dsJO.Tables
("JobOper").Rows(0)("QtyCompleted")
Total = (Qty + vQcmplt)
Dim TQ As String = Total.ToString()
if Total > vQreq then
msgbox("There are " & vQcmplt & " part(s) claimed as
complete. " _
& "Claiming " & Qty & " will result in more than the
required quantity of " _
& vQreq & ".")
nbrQty.Focus
nbrQty.ResetBindings()
nbrQty.resetvalue()
nbrQty.value = 0
Throw new UIException
vLqty = 0
nbrQty.refresh()
adpJO.Dispose()
End If
btnOK.PerformClick()
End Sub
n BPM to prevent User from logging into completed ops (labor.update)
Number of rows in the query is not less than 1
For each ttLaborDtl where ttLaborDtl.RowMod = 'A' no-lock ,
each JobOper where ttLaborDtl.company = JobOper.company and
ttLaborDtl.JobNum = JobOper.JobNum and ttLaborDtl.AssemblySeq =
JobOper.AssemblySeq and ttLaborDtl.OprSeq = JobOper.OprSeq and
Joboper.OpComplete = True no-lock
Rob Bucek
Manufacturing Engineer
PH: (715) 284-5376 ext 3111
Mobile: (715)896-0590
FAX: (715)284-4084
<http://www.dsmfg.com/>
(Click the logo to view our site) <http://www.dsmfg.com/>
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of howco22
Sent: Thursday, May 06, 2010 10:31 AM
To: vantage@yahoogroups.com
Subject: [Vantage] BPM to raise exception if Current Qty exceeds qty on
Job
We are on 9.04.506b, I need to create a BPM (on End Activity on an MES
station) that will raise an exception if the current quantity being
reported, is greater than the quantity required on the job. Ive built
other BPM's with no major problem, however I'm stuck as to where to
start on this one, as it looks like they are in two separate tables..
has anybody here written a BPM for this? If, so, willing to share??, if
not point me to the starting point?
thanks
Andy
[Non-text portions of this message have been removed]
easier... here is the logic I used in that script, it could help you in
formulating your BPM. Ill also attach code I used to prevent an user
from logging into an operation that is already completed (we often had
them log in, make parts because they managed to get a hold of a
duplicate traveler or what have you) and wed have an over production
situation. Since the discipline to log in was there, this has greatly
reduced if not eliminated that problem altogether. You could use that
code to build from. It will be the same bo/method in either case.
n Prevent user from over reporting on end activity (hide the original
vantage OK button and substitute your own)
Private Sub btnOK2_Click(ByVal Sender As Object, ByVal Args As
System.EventArgs) Handles btnOK2.Click
Dim edvSPA As EpiDataView =
CType(oTrans.EpiDataViews("End"), EpiDataView)
Dim vLtype As String =
edvSPA.dataView(edvSpa.row)("LaborType")
if vLtype = "P" Then
GetQtyCmplt()
End If
btnOK.PerformClick()
End Sub
Private Sub GetQtyCmplt()
'// ** Place Event Handling Code Here **
Dim edvSPA As EpiDataView =
CType(oTrans.EpiDataViews("End"), EpiDataView)
Dim nbrQty As EpiNumericEditor =
ctype(csm.GetNativeControlReference("f1fdcf24-066d-424e-9b59-319a804854f
a"),EpiNumericEditor)
Dim Qty As String = nbrQty.value
Dim vLqty As Decimal =
edvSPA.dataView(edvSpa.row)("LaborQty")
Dim vJob As String = edvSPA.dataView(edvSpa.Row)("JobNum")
Dim vAssy As String =
edvSPA.dataView(edvSpa.Row)("AssemblySeq")
Dim vOper As String = edvSPA.dataView(edvSpa.Row)("OprSeq")
Dim Total as Integer = 0
Dim adpJO As JobOperSearchAdapter = New
JobOperSearchAdapter(EndActForm)
adpJO.BOConnect()
Dim record As Boolean = adpJO.GetByID(vJob, vAssy, vOper)
Dim dsJO As JobOperSearchDataSet = adpJO.JobOperSearchData
Dim vQreq as Integer = dsJO.Tables
("JobOper").Rows(0)("RunQty")
Dim vQcmplt as Integer = dsJO.Tables
("JobOper").Rows(0)("QtyCompleted")
Total = (Qty + vQcmplt)
Dim TQ As String = Total.ToString()
if Total > vQreq then
msgbox("There are " & vQcmplt & " part(s) claimed as
complete. " _
& "Claiming " & Qty & " will result in more than the
required quantity of " _
& vQreq & ".")
nbrQty.Focus
nbrQty.ResetBindings()
nbrQty.resetvalue()
nbrQty.value = 0
Throw new UIException
vLqty = 0
nbrQty.refresh()
adpJO.Dispose()
End If
btnOK.PerformClick()
End Sub
n BPM to prevent User from logging into completed ops (labor.update)
Number of rows in the query is not less than 1
For each ttLaborDtl where ttLaborDtl.RowMod = 'A' no-lock ,
each JobOper where ttLaborDtl.company = JobOper.company and
ttLaborDtl.JobNum = JobOper.JobNum and ttLaborDtl.AssemblySeq =
JobOper.AssemblySeq and ttLaborDtl.OprSeq = JobOper.OprSeq and
Joboper.OpComplete = True no-lock
Rob Bucek
Manufacturing Engineer
PH: (715) 284-5376 ext 3111
Mobile: (715)896-0590
FAX: (715)284-4084
<http://www.dsmfg.com/>
(Click the logo to view our site) <http://www.dsmfg.com/>
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of howco22
Sent: Thursday, May 06, 2010 10:31 AM
To: vantage@yahoogroups.com
Subject: [Vantage] BPM to raise exception if Current Qty exceeds qty on
Job
We are on 9.04.506b, I need to create a BPM (on End Activity on an MES
station) that will raise an exception if the current quantity being
reported, is greater than the quantity required on the job. Ive built
other BPM's with no major problem, however I'm stuck as to where to
start on this one, as it looks like they are in two separate tables..
has anybody here written a BPM for this? If, so, willing to share??, if
not point me to the starting point?
thanks
Andy
[Non-text portions of this message have been removed]