Thanks again for all your help. I actually do want that field to
constantly change on the screen. Here is what I am trying to do.
Customer service keeps changing quantities and dates when the original
ship to date is less than 4 weeks out. We want to lock them out from
doing this. I used the before field change code to disallow date changes
within 30 days of NeedByDate. However, I can't figure out how to add the
Case statement for SellingQuantity based on the NeedByDate and whether
it is less than 4 weeks out.
The calculated field on the screen I thought would be two-fold. For one
the CS person would see the actual 30-day out date on the screen, more
of a visual thing. Second I thought perhaps I could use the rule wizard
to compare the NeedByDate with the calculated field and then disable the
selling quantity field if the date is less than 30 days out. The rule
wizard doesn't work though because it only looks at the views, not the
custom fields. So now I am back to trying to figure out how to get the
Before Field Change code to work. Any further ideas would be
appreciated. This is driving me crazy. Thanks!
THIS WORKS - but how do I write it for the sellingquantity?
Case "NeedByDate"
If Ctype(args.proposedvalue, System.DateTime) <
System.DateTime.Today.AddDays(30) Then
Throw New Exception("You are not authorized to enter a Need By
Date less than 4 weeks out.")
Dawn Stenbol
IT Manager
Wiza Industries
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Bill Baraski
Sent: Thursday, January 10, 2008 12:24 PM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] Calculated Field on a Form - is it possible?
Well I thought about it, and you actually do not want to bind that to
anything. If you did, everytime you opened that sales order, the date
would change to 30 days from current day. (You really wouldn't want
that) You could base it off of the OrderDate but then you'd have to make
sure it loads from a couple of different places. Ie: On Field Change.
There is another one you'll have to add but You got me which one it is.
With this code it will change when the OrderDate field is changed.
Problem is, it doesn't change when it first loads. Hopefully you can get
an answer from someone in here about which one you use for that.
Private Sub OrderHed_AfterFieldChange(ByVal sender As object, ByVal args
As DataColumnChangeEventArgs) Handles OrderHed_Column.ColumnChanged
Select Case args.Column.ColumnName
Case "OrderDate"
Dim ORView As EpiDataView = CType(oTrans.EpiDataViews("OrderHed"),
EpiDataView)
Dim OrderDate As DateTime = ORView.dataView(ORView.Row)("OrderDate")
if ISDATE(OrderDate) = True Then
dteEpiCustom1. value = DateAdd("d", 30,OrderDate)
End If
End Select
End Sub
The other way you could do it is to make a button.
Use an On Click Method on that EpiButton then use this as your code.
Then anytime you click that button and OrderDate is a Date, it will
update.
Dim ORView As EpiDataView = CType(oTrans.EpiDataViews("OrderHed"),
EpiDataView)
Dim OrderDate As DateTime = ORView.dataView(ORView.Row)("OrderDate")
if ISDATE(OrderDate) = True Then
dteEpiCustom1. value = DateAdd("d", 30,OrderDate)
End If
So hopefully this got you something that is close to what you wanted.
----- Original Message ----
From: Dawn Stenbol <dstenbol@...
<mailto:dstenbol%40wizaindustries.com> >
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Sent: Wednesday, January 9, 2008 2:50:20 PM
Subject: RE: [Vantage] Calculated Field on a Form - is it possible?
Thanks a million Bill. Do I run the AddBinding code on the Load form
event?
Dawn
From: vantage@yahoogroups .com [mailto:vantage@yahoogroups .com] On
Behalf
Of Bill Baraski
Sent: Tuesday, January 08, 2008 7:00 PM
To: vantage@yahoogroups .com
Subject: Re: [Vantage] Calculated Field on a Form - is it possible?
Using an Event Wizard and using Load, - Make sure you bind it to a
datafield in order to save it.
Private Sub SalesOrderForm_ Load(ByVal sender As object, ByVal args As
EventArgs) Handles SalesOrderForm. Load
'//
'// Add Event Handler Code
'//
End Sub
----- Original Message ----
From: Dawn Stenbol <dstenbol@wizaindust ries.com
<mailto:dstenbol% 40wizaindustries .com> >
To: vantage@yahoogroups .com <mailto:vantage% 40yahoogroups. com>
Sent: Tuesday, January 8, 2008 1:37:59 PM
Subject: [Vantage] Calculated Field on a Form - is it possible?
Is it possible to created a calculated field on a form? I am trying to
create a field on the Order Entry screen that will always show (Current
Date + 30 days).
Dawn Stenbol
IT Manager
Wiza Industries
[Non-text portions of this message have been removed]
____________ _________ _________ _________ _________ _________ _
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
http://mobile. yahoo.com/ ;_ylt=Ahu06i62sR 8HDtDypao8Wcj9tA cJ
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
__________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
constantly change on the screen. Here is what I am trying to do.
Customer service keeps changing quantities and dates when the original
ship to date is less than 4 weeks out. We want to lock them out from
doing this. I used the before field change code to disallow date changes
within 30 days of NeedByDate. However, I can't figure out how to add the
Case statement for SellingQuantity based on the NeedByDate and whether
it is less than 4 weeks out.
The calculated field on the screen I thought would be two-fold. For one
the CS person would see the actual 30-day out date on the screen, more
of a visual thing. Second I thought perhaps I could use the rule wizard
to compare the NeedByDate with the calculated field and then disable the
selling quantity field if the date is less than 30 days out. The rule
wizard doesn't work though because it only looks at the views, not the
custom fields. So now I am back to trying to figure out how to get the
Before Field Change code to work. Any further ideas would be
appreciated. This is driving me crazy. Thanks!
THIS WORKS - but how do I write it for the sellingquantity?
Case "NeedByDate"
If Ctype(args.proposedvalue, System.DateTime) <
System.DateTime.Today.AddDays(30) Then
Throw New Exception("You are not authorized to enter a Need By
Date less than 4 weeks out.")
Dawn Stenbol
IT Manager
Wiza Industries
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Bill Baraski
Sent: Thursday, January 10, 2008 12:24 PM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] Calculated Field on a Form - is it possible?
Well I thought about it, and you actually do not want to bind that to
anything. If you did, everytime you opened that sales order, the date
would change to 30 days from current day. (You really wouldn't want
that) You could base it off of the OrderDate but then you'd have to make
sure it loads from a couple of different places. Ie: On Field Change.
There is another one you'll have to add but You got me which one it is.
With this code it will change when the OrderDate field is changed.
Problem is, it doesn't change when it first loads. Hopefully you can get
an answer from someone in here about which one you use for that.
Private Sub OrderHed_AfterFieldChange(ByVal sender As object, ByVal args
As DataColumnChangeEventArgs) Handles OrderHed_Column.ColumnChanged
Select Case args.Column.ColumnName
Case "OrderDate"
Dim ORView As EpiDataView = CType(oTrans.EpiDataViews("OrderHed"),
EpiDataView)
Dim OrderDate As DateTime = ORView.dataView(ORView.Row)("OrderDate")
if ISDATE(OrderDate) = True Then
dteEpiCustom1. value = DateAdd("d", 30,OrderDate)
End If
End Select
End Sub
The other way you could do it is to make a button.
Use an On Click Method on that EpiButton then use this as your code.
Then anytime you click that button and OrderDate is a Date, it will
update.
Dim ORView As EpiDataView = CType(oTrans.EpiDataViews("OrderHed"),
EpiDataView)
Dim OrderDate As DateTime = ORView.dataView(ORView.Row)("OrderDate")
if ISDATE(OrderDate) = True Then
dteEpiCustom1. value = DateAdd("d", 30,OrderDate)
End If
So hopefully this got you something that is close to what you wanted.
----- Original Message ----
From: Dawn Stenbol <dstenbol@...
<mailto:dstenbol%40wizaindustries.com> >
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Sent: Wednesday, January 9, 2008 2:50:20 PM
Subject: RE: [Vantage] Calculated Field on a Form - is it possible?
Thanks a million Bill. Do I run the AddBinding code on the Load form
event?
Dawn
From: vantage@yahoogroups .com [mailto:vantage@yahoogroups .com] On
Behalf
Of Bill Baraski
Sent: Tuesday, January 08, 2008 7:00 PM
To: vantage@yahoogroups .com
Subject: Re: [Vantage] Calculated Field on a Form - is it possible?
Using an Event Wizard and using Load, - Make sure you bind it to a
datafield in order to save it.
Private Sub SalesOrderForm_ Load(ByVal sender As object, ByVal args As
EventArgs) Handles SalesOrderForm. Load
'//
'// Add Event Handler Code
'//
End Sub
----- Original Message ----
From: Dawn Stenbol <dstenbol@wizaindust ries.com
<mailto:dstenbol% 40wizaindustries .com> >
To: vantage@yahoogroups .com <mailto:vantage% 40yahoogroups. com>
Sent: Tuesday, January 8, 2008 1:37:59 PM
Subject: [Vantage] Calculated Field on a Form - is it possible?
Is it possible to created a calculated field on a form? I am trying to
create a field on the Order Entry screen that will always show (Current
Date + 30 days).
Dawn Stenbol
IT Manager
Wiza Industries
[Non-text portions of this message have been removed]
____________ _________ _________ _________ _________ _________ _
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
http://mobile. yahoo.com/ ;_ylt=Ahu06i62sR 8HDtDypao8Wcj9tA cJ
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
__________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]