Updating a Field based on other field

This was perfect for what I just needed.

I wanted to provide an RMACloseDate field, and Vantage doesn't keep track of that (at least not in 8.03.405).

So I did this:

Private Sub RMAHead_BeforeFieldChange(ByVal sender As object, ByVal args As DataColumnChangeEventArgs) Handles RMAHead_Column.ColumnChanging
'// ** Argument Properties and Uses **
'// args.Row("[FieldName]")
'// args.Column, args.ProposedValue, args.Row
'
'Add Event Handler Code
'
Dim edv As EpiDataView = CType(oTrans.EpiDataViews("RMAHead"), EpiDataView)

Select Case args.Column.ColumnName

'//Since this is a boolean field, we can look at the current value and decide what to do.
Case "OpenRMA"
if edv.dataView(edv.Row)("OpenRMA") = False then
'MessageBox.Show("Opening")
edv.dataView(edv.Row)("Date03") = DBNull.Value
else
'MessageBox.Show("Closing")
edv.dataView(edv.Row)("Date03") = DateTime.Now
end if

Case Else

End Select

End Sub


--
Brian W. Spolarich ~ Manager, Information Services ~ Advanced Photonix / Picometrix
    bspolarich@... ~ 734-864-5618 ~ www.advancedphotonix.com


-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of efyf_1999
Sent: Thursday, April 29, 2010 1:26 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Updating a Field based on other field

Thanks to Sean i was able to get it work

Seams i had to close the screen and reopen for it to work

Ephraim

--- In vantage@yahoogroups.com, "efyf_1999" <effgroups@...> wrote:
>
> Thanks Sean,
>
> I tried it and it still didnt work.
> At what time will the other field be updated? when i change the value? what will happen if there is a value already?
>
> here is the code i did
>
> Private Sub ProjectTask_AfterFieldChange(ByVal sender As object, ByVal args As DataColumnChangeEventArgs) Handles ProjectTask_Column.ColumnChanged
> '// ** Argument Properties and Uses **
> '// args.Row("[FieldName]")
> '// args.Column, args.ProposedValue, args.Row
> '
> 'Add Event Handler Code
> '
>
> Dim EDV As EpiDataView = CType(oTrans.EpiDataViews("ProjectTask"), EpiDataView)
>
> Select Case args.Column.ColumnName
>
> Case "Number03"
> EDV.dataView(EDV.Row)("Duration") = EDV.dataView(EDV.Row)("Number03")
>
> Case Else
>
> End Select
>
> End Sub
>
>
> Please help me
>
> Thanks
>
> Ephraim
>
> --- In vantage@yahoogroups.com, "Sean McDaniel" <smcdaniel@> wrote:
> >
> > When you are in the form you can go into the wizards and hook into the
> > on-change event of the added field.
> >
> > When this event triggers you can update your other field (go into tools,
> > object explorer, click on the data objects tab to find your field that
> > you want to change)
> >
> > Would typically be something like this in the form customization...
> >
> > Private Sub BAQReportParam_AfterFieldChange(ByVal sender As object,
> > ByVal args As DataColumnChangeEventArgs) Handles
> > BAQReportParam_Column.ColumnChanged
> >
> > '// ** Argument Properties and Uses **
> >
> > '// args.Row("[FieldName]")
> >
> > '// args.Column, args.ProposedValue, args.Row
> >
> > '
> >
> > 'Add Event Handler Code
> >
> > '
> >
> > Select Case args.Column.ColumnName
> >
> >
> >
> > Case "Character02"
> >
> > Dim [edvVarName] As
> > EpiDataView = CType(oTrans.EpiDataViews("ReportParam"), EpiDataView)
> >
> >
> > [edvVarName].dataView([edvVarName].Row)("Character01") =
> > [edvVarName].dataView([edvVarName].Row)("Character02")
> >
> > Case Else
> >
> > End Select
> >
> >
> >
> > End Sub
> >
> >
> >
> > From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
> > Of efyf_1999
> > Sent: Thursday, April 29, 2010 10:47 AM
> > To: vantage@yahoogroups.com
> > Subject: [Vantage] Updating a Field based on other field
> >
> >
> >
> >
> >
> > Hi all,
> >
> > I'm going to ask a very simple thing but dont laugh at me since im not
> > yet so familiar with vista nd everything i know i learned on my own.
> >
> > I added a custom numeric field in the Project task and now i want to
> > update the duration field with that new field multiplied by 0.5 whenever
> > a user changes that field what are my uptions?
> >
> > Thanks for the help
> >
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>




------------------------------------

Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and Crystal Reports and other 'goodies', please goto: http://groups.yahoo.com/group/vantage/files/.
(2) To search through old msg's goto: http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto: http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links
Hi all,

I'm going to ask a very simple thing but dont laugh at me since im not yet so familiar with vista nd everything i know i learned on my own.

I added a custom numeric field in the Project task and now i want to update the duration field with that new field multiplied by 0.5 whenever a user changes that field what are my uptions?

Thanks for the help
When you are in the form you can go into the wizards and hook into the
on-change event of the added field.

When this event triggers you can update your other field (go into tools,
object explorer, click on the data objects tab to find your field that
you want to change)

Would typically be something like this in the form customization...

Private Sub BAQReportParam_AfterFieldChange(ByVal sender As object,
ByVal args As DataColumnChangeEventArgs) Handles
BAQReportParam_Column.ColumnChanged

'// ** Argument Properties and Uses **

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

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

'

'Add Event Handler Code

'

Select Case args.Column.ColumnName



Case "Character02"

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


[edvVarName].dataView([edvVarName].Row)("Character01") =
[edvVarName].dataView([edvVarName].Row)("Character02")

Case Else

End Select



End Sub



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of efyf_1999
Sent: Thursday, April 29, 2010 10:47 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Updating a Field based on other field





Hi all,

I'm going to ask a very simple thing but dont laugh at me since im not
yet so familiar with vista nd everything i know i learned on my own.

I added a custom numeric field in the Project task and now i want to
update the duration field with that new field multiplied by 0.5 whenever
a user changes that field what are my uptions?

Thanks for the help





[Non-text portions of this message have been removed]
Thanks Sean,

I tried it and it still didnt work.
At what time will the other field be updated? when i change the value? what will happen if there is a value already?

here is the code i did

Private Sub ProjectTask_AfterFieldChange(ByVal sender As object, ByVal args As DataColumnChangeEventArgs) Handles ProjectTask_Column.ColumnChanged
'// ** Argument Properties and Uses **
'// args.Row("[FieldName]")
'// args.Column, args.ProposedValue, args.Row
'
'Add Event Handler Code
'

Dim EDV As EpiDataView = CType(oTrans.EpiDataViews("ProjectTask"), EpiDataView)

Select Case args.Column.ColumnName

Case "Number03"
EDV.dataView(EDV.Row)("Duration") = EDV.dataView(EDV.Row)("Number03")

Case Else

End Select

End Sub


Please help me

Thanks

Ephraim

--- In vantage@yahoogroups.com, "Sean McDaniel" <smcdaniel@...> wrote:
>
> When you are in the form you can go into the wizards and hook into the
> on-change event of the added field.
>
> When this event triggers you can update your other field (go into tools,
> object explorer, click on the data objects tab to find your field that
> you want to change)
>
> Would typically be something like this in the form customization...
>
> Private Sub BAQReportParam_AfterFieldChange(ByVal sender As object,
> ByVal args As DataColumnChangeEventArgs) Handles
> BAQReportParam_Column.ColumnChanged
>
> '// ** Argument Properties and Uses **
>
> '// args.Row("[FieldName]")
>
> '// args.Column, args.ProposedValue, args.Row
>
> '
>
> 'Add Event Handler Code
>
> '
>
> Select Case args.Column.ColumnName
>
>
>
> Case "Character02"
>
> Dim [edvVarName] As
> EpiDataView = CType(oTrans.EpiDataViews("ReportParam"), EpiDataView)
>
>
> [edvVarName].dataView([edvVarName].Row)("Character01") =
> [edvVarName].dataView([edvVarName].Row)("Character02")
>
> Case Else
>
> End Select
>
>
>
> End Sub
>
>
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
> Of efyf_1999
> Sent: Thursday, April 29, 2010 10:47 AM
> To: vantage@yahoogroups.com
> Subject: [Vantage] Updating a Field based on other field
>
>
>
>
>
> Hi all,
>
> I'm going to ask a very simple thing but dont laugh at me since im not
> yet so familiar with vista nd everything i know i learned on my own.
>
> I added a custom numeric field in the Project task and now i want to
> update the duration field with that new field multiplied by 0.5 whenever
> a user changes that field what are my uptions?
>
> Thanks for the help
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
Thanks to Sean i was able to get it work

Seams i had to close the screen and reopen for it to work

Ephraim

--- In vantage@yahoogroups.com, "efyf_1999" <effgroups@...> wrote:
>
> Thanks Sean,
>
> I tried it and it still didnt work.
> At what time will the other field be updated? when i change the value? what will happen if there is a value already?
>
> here is the code i did
>
> Private Sub ProjectTask_AfterFieldChange(ByVal sender As object, ByVal args As DataColumnChangeEventArgs) Handles ProjectTask_Column.ColumnChanged
> '// ** Argument Properties and Uses **
> '// args.Row("[FieldName]")
> '// args.Column, args.ProposedValue, args.Row
> '
> 'Add Event Handler Code
> '
>
> Dim EDV As EpiDataView = CType(oTrans.EpiDataViews("ProjectTask"), EpiDataView)
>
> Select Case args.Column.ColumnName
>
> Case "Number03"
> EDV.dataView(EDV.Row)("Duration") = EDV.dataView(EDV.Row)("Number03")
>
> Case Else
>
> End Select
>
> End Sub
>
>
> Please help me
>
> Thanks
>
> Ephraim
>
> --- In vantage@yahoogroups.com, "Sean McDaniel" <smcdaniel@> wrote:
> >
> > When you are in the form you can go into the wizards and hook into the
> > on-change event of the added field.
> >
> > When this event triggers you can update your other field (go into tools,
> > object explorer, click on the data objects tab to find your field that
> > you want to change)
> >
> > Would typically be something like this in the form customization...
> >
> > Private Sub BAQReportParam_AfterFieldChange(ByVal sender As object,
> > ByVal args As DataColumnChangeEventArgs) Handles
> > BAQReportParam_Column.ColumnChanged
> >
> > '// ** Argument Properties and Uses **
> >
> > '// args.Row("[FieldName]")
> >
> > '// args.Column, args.ProposedValue, args.Row
> >
> > '
> >
> > 'Add Event Handler Code
> >
> > '
> >
> > Select Case args.Column.ColumnName
> >
> >
> >
> > Case "Character02"
> >
> > Dim [edvVarName] As
> > EpiDataView = CType(oTrans.EpiDataViews("ReportParam"), EpiDataView)
> >
> >
> > [edvVarName].dataView([edvVarName].Row)("Character01") =
> > [edvVarName].dataView([edvVarName].Row)("Character02")
> >
> > Case Else
> >
> > End Select
> >
> >
> >
> > End Sub
> >
> >
> >
> > From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
> > Of efyf_1999
> > Sent: Thursday, April 29, 2010 10:47 AM
> > To: vantage@yahoogroups.com
> > Subject: [Vantage] Updating a Field based on other field
> >
> >
> >
> >
> >
> > Hi all,
> >
> > I'm going to ask a very simple thing but dont laugh at me since im not
> > yet so familiar with vista nd everything i know i learned on my own.
> >
> > I added a custom numeric field in the Project task and now i want to
> > update the duration field with that new field multiplied by 0.5 whenever
> > a user changes that field what are my uptions?
> >
> > Thanks for the help
> >
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>