Hi
We need to set a checkbox to True when a new record is created in the RMAHead table. We would use a BPM but we only want the checkbox marked as true when a specific customised form is used.
The field name is WarrantyRMA_c and it is in the RMAHead table, in vantage the code was
Private Sub edvRMAHead_EpiViewNotification(view As EpiDataView, args As EpiNotifyArgs) Handles edvRMAHead.EpiViewNotification
'// ** Argument Properties and Uses **
'// view.dataView(args.Row)("[FieldName]")
'// args.Row, args.Column, args.Sender, args.NotifyType
'// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
If (args.NotifyType = EpiTransaction.NotifyType.AddRow) Then
If (args.Row > -1) Then
Dim RMAHead As EpiDataView = CType(oTrans.EpiDataViews("RMAHead"), EpiDataView)
RMAHead.dataview(RMAHead.Row)("Checkbox01") = "TRUE"
End If
End If
End Sub
Converted to C# (using an online converter) it is
private void edvRMAHead_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
{
//// ** Argument Properties and Uses **
//// view.dataView(args.Row)("[FieldName]")
//// args.Row, args.Column, args.Sender, args.NotifyType
//// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
if ((args.NotifyType == EpiTransaction.NotifyType.AddRow)) {
if ((args.Row > -1)) {
EpiDataView RMAHead = (EpiDataView)oTrans.EpiDataViews("RMAHead");
RMAHead.dataview(RMAHead.Row)("WarrantyRMA_c") = "TRUE";
}
}
}
When I add this to the Form Event Wizard as a EpiViewNotification and select Update Selected code and test the code i get theses compile errors
Error: CS1955 - line 97 (588) - Non-invocable member âIce.Lib.Framework.EpiTransaction.EpiDataViewsâ cannot be used like a method.
Error: CS1061 - line 98 (589) - âIce.Lib.Framework.EpiDataViewâ does not contain a definition for âdataviewâ and no extension method âdataviewâ accepting a first argument of type âIce.Lib.Framework.EpiDataViewâ could be found (are you missing a using directive or an assembly reference?)
I am a complete novice regarding any sort of coding so please bear this in mind.
thanks in Advance
Mark