Receipt Entry - Prevent receipt date prior to today()

Doing it in that screen in particular won’t stop other screens or processes from doing it however. So if you folks utilize the handheld module or MES you will need to update all of them, along with all the ones launched by Process Calling.

 

Joshua Giese
Technology Solutions : CTO

Direct Phone:    920.593.8299
Office Phone:    920.437.6400 x342

http://wcibags.com/email/emailFooter4.jpg

http://68c6d48672d1935cd6dd-141aaade86a30aeaf83cb6aee3728aaa.r82.cf1.rackcdn.com/images/global/Holiday-Schedule-2015.jpg

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Thursday, December 3, 2015 1:43 PM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Receipt Entry - Prevent receipt date prior to today()

 

 

Yeah.

 

It's working now.  

 

Turns out that the unable to update the receipt was caused by another factor.  The VBScript code is what I'm using right in a customization of the Receipt Entry form.  I could not successfully apply a condition based of the Date(Today) variable in ABL.  

 

Thanks!

Hello everybody!


I'm trying to prevent users from creating a receipt with a receipt date prior to today.


I created a BPM, but was unable to use the wizard to throw an exception with a variable of today() in ABL, I can create an exception, but it requires an actual date and won't except a variable. 


I then created an if statement to throw an exception or message if the date is before today() as in: 


Private Sub RcvHead_AfterFieldChange(ByVal sender As object, ByVal args As DataColumnChangeEventArgs) Handles RcvHead_Column.ColumnChanged

'// ** Argument Properties and Uses **

'// args.Row("[FieldName]")

'// args.Column, args.ProposedValue, args.Row

'

'Add Event Handler Code

'

       

Dim [edvVarName] As EpiDataView = CType(oTrans.EpiDataViews("RcvHead"), EpiDataView)

Dim [VarName] As DateTime = [edvVarName].dataView([edvVarName].Row)("ReceiptDate")

Dim myDate As Date

myDate = DateValue(Now)

        

Select Case args.Column.ColumnName       

Case Else

                if ([varname] < mydate)

                throw new exception("Invalid date")

                end if 

End Select

End Sub


The previous throws the exception, but returns that it cannot update the Receipt Date field, even if the date doesn't throw an exception. 


I'm still running 8.03.410


This should work as a BPM? You said you can get the exception as a BPM but then I didn’t fully follow the part that wasn’t working

 

Joshua Giese
Technology Solutions : CTO

Direct Phone:    920.593.8299
Office Phone:    920.437.6400 x342

http://wcibags.com/email/emailFooter4.jpg

http://68c6d48672d1935cd6dd-141aaade86a30aeaf83cb6aee3728aaa.r82.cf1.rackcdn.com/images/global/Holiday-Schedule-2015.jpg

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Thursday, December 3, 2015 11:01 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Receipt Entry - Prevent receipt date prior to today()

 

 

Hello everybody!

 

I'm trying to prevent users from creating a receipt with a receipt date prior to today.

 

I created a BPM, but was unable to use the wizard to throw an exception with a variable of today() in ABL, I can create an exception, but it requires an actual date and won't except a variable. 

 

I then created an if statement to throw an exception or message if the date is before today() as in: 

 

Private Sub RcvHead_AfterFieldChange(ByVal sender As object, ByVal args As DataColumnChangeEventArgs) Handles RcvHead_Column.ColumnChanged

                        '// ** Argument Properties and Uses **

                        '// args.Row("[FieldName]")

                        '// args.Column, args.ProposedValue, args.Row

                        '

                        'Add Event Handler Code

                        '

       

Dim [edvVarName] As EpiDataView = CType(oTrans.EpiDataViews("RcvHead"), EpiDataView)

Dim [VarName] As DateTime = [edvVarName].dataView([edvVarName].Row)("ReceiptDate")

Dim myDate As Date

myDate = DateValue(Now)

        

                        Select Case args.Column.ColumnName       

                                    Case Else

                if ([varname] < mydate)

                throw new exception("Invalid date")

                end if 

                        End Select

            End Sub

 

The previous throws the exception, but returns that it cannot update the Receipt Date field, even if the date doesn't throw an exception. 

 

I'm still running 8.03.410

 

It could be a date format issue...

Sent from my iPhone

On Dec 3, 2015, at 12:03 PM, Joshua Giese jgiese@... [vantage] <vantage@yahoogroups.com> wrote:

 

This should work as a BPM? You said you can get the exception as a BPM but then I didn’t fully follow the part that wasn’t working

 

Joshua Giese
Technology Solutions : CTO

Direct Phone:    920.593.8299
Office Phone:    920.437.6400 x342

http://wcibags.com/email/emailFooter4.jpg

http://68c6d48672d1935cd6dd-141aaade86a30aeaf83cb6aee3728aaa.r82.cf1.rackcdn.com/images/global/Holiday-Schedule-2015.jpg

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Thursday, December 3, 2015 11:01 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Receipt Entry - Prevent receipt date prior to today()

 

 

Hello everybody!

 

I'm trying to prevent users from creating a receipt with a receipt date prior to today.

 

I created a BPM, but was unable to use the wizard to throw an exception with a variable of today() in ABL, I can create an exception, but it requires an actual date and won't except a variable. 

 

I then created an if statement to throw an exception or message if the date is before today() as in: 

 

Private Sub RcvHead_AfterFieldChange(ByVal sender As object, ByVal args As DataColumnChangeEventArgs) Handles RcvHead_Column.ColumnChanged

                        '// ** Argument Properties and Uses **

                        '// args.Row("[FieldName]")

                        '// args.Column, args.ProposedValue, args.Row

                        '

                        'Add Event Handler Code

                        '

       

Dim [edvVarName] As EpiDataView = CType(oTrans.EpiDataViews("RcvHead"), EpiDataView)

Dim [VarName] As DateTime = [edvVarName].dataView([edvVarName].Row)("ReceiptDate")

Dim myDate As Date

myDate = DateValue(Now)

        

                        Select Case args.Column.ColumnName       

                                    Case Else

                if ([varname] < mydate)

                throw new exception("Invalid date")

                end if 

                        End Select

            End Sub

 

The previous throws the exception, but returns that it cannot update the Receipt Date field, even if the date doesn't throw an exception. 

 

I'm still running 8.03.410

 

Here's the BPM condition: 

the RcvHead.ReceiptDate field of the changed row is less than the Date(12,01,2015) value

the problem is the date needs to be a variable function of today().  I've created a variable in advanced and assigned to today(), but it still wants the literal date. 


Dates are always a big pain.  Try putting the value(s) you are using into a popup to see what format is actually coming up.

 

In ABL you just need “TODAY”

 

These are E9 examples if they help.

 

set the Part.Date01 field of the changed row to the  Today expression

 

ASSIGN JobOper.Number03 = (IF (JobHead.Date01 = TODAY) THEN (1) ELSE (0)).

 

Brenda

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Thursday, December 03, 2015 12:01 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Receipt Entry - Prevent receipt date prior to today()

 

 

Hello everybody!

 

I'm trying to prevent users from creating a receipt with a receipt date prior to today.

 

I created a BPM, but was unable to use the wizard to throw an exception with a variable of today() in ABL, I can create an exception, but it requires an actual date and won't except a variable. 

 

I then created an if statement to throw an exception or message if the date is before today() as in: 

 

Private Sub RcvHead_AfterFieldChange(ByVal sender As object, ByVal args As DataColumnChangeEventArgs) Handles RcvHead_Column.ColumnChanged

                        '// ** Argument Properties and Uses **

                        '// args.Row("[FieldName]")

                        '// args.Column, args.ProposedValue, args.Row

                        '

                        'Add Event Handler Code

                        '

       

Dim [edvVarName] As EpiDataView = CType(oTrans.EpiDataViews("RcvHead"), EpiDataView)

Dim [VarName] As DateTime = [edvVarName].dataView([edvVarName].Row)("ReceiptDate")

Dim myDate As Date

myDate = DateValue(Now)

        

                        Select Case args.Column.ColumnName       

                                    Case Else

                if ([varname] < mydate)

                throw new exception("Invalid date")

                end if 

                        End Select

            End Sub

 

The previous throws the exception, but returns that it cannot update the Receipt Date field, even if the date doesn't throw an exception. 

 

I'm still running 8.03.410

 

The variable is TODAY not TODAY() if you are using it as such you are going to have trouble. Using TODAY in the expression for the condition should be working post a screenshot of it on imgur or something as exactly what you have. So we can take a look.

 

Joshua Giese
Technology Solutions : CTO

Direct Phone:    920.593.8299
Office Phone:    920.437.6400 x342

http://wcibags.com/email/emailFooter4.jpg

http://68c6d48672d1935cd6dd-141aaade86a30aeaf83cb6aee3728aaa.r82.cf1.rackcdn.com/images/global/Holiday-Schedule-2015.jpg

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Thursday, December 3, 2015 11:19 AM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] Receipt Entry - Prevent receipt date prior to today()

 

 

Here's the BPM condition: 

 

the RcvHead.ReceiptDate field of the changed row is less than the Date(12,01,2015) value

 

the problem is the date needs to be a variable function of today().  I've created a variable in advanced and assigned to today(), but it still wants the literal date. 

 

 

Yeah.

It's working now.  

Turns out that the unable to update the receipt was caused by another factor.  The VBScript code is what I'm using right in a customization of the Receipt Entry form.  I could not successfully apply a condition based of the Date(Today) variable in ABL.  

Thanks!