So, after looking at it and discussing with a colleague, the desire is simply to default OrderDtl.LockPrice to true on new OrderDtl records.
Do I need a Data Rule in App Studio, or is it an event?
[Original text below]
I’m guessing this will be very easy to someone here.
I’ve been asked to convert this part of a Classic Screen to Kinetic. Specifically, the edvOrderDtl_EpiViewNotification method.
I’ve included the calling method InitializeCustomCode. I don’t really understand the classic code very much. ![]()
So, the way I read this is…
if the edvOrderDtl_EpiViewNotification method is called and
if you are adding a row
then set the LockPrice to 1.0?
Which, I presume (and we all know what THAT means) might set the Price field to be read-only?
So, how would I accomplish that same feat for the same conditions in Kinetic?
Choices:
- Use the correct events (which ones?) and do it in App Studio (but how?)
- Create a C# Data Directive (but what exactly does it need to do?)
- Other ways?
Thanks in advance.
I realize I have so much to learn here.
public void InitializeCustomCode()
{
// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
// Begin Wizard Added Variable Initialization
this.oTrans_ordAdapter = ((EpiBaseAdapter)(this.csm.TransAdaptersHT["oTrans_ordAdapter"]));
this.oTrans_ordAdapter.BeforeAdapterMethod += new BeforeAdapterMethod(this.oTrans_ordAdapter_BeforeAdapterMethod);
this.OrderDtl_Row.EpiRowChanged += new EpiRowChanged(this.OrderDtl_AfterRowChange);
this.OrderDtl_Column.ColumnChanged += new DataColumnChangeEventHandler(this.OrderDtl_AfterFieldChange);
this.OrderHed_Column.ColumnChanged += new DataColumnChangeEventHandler(this.OrderHed_AfterFieldChange);
this.edvOrderDtl = ((EpiDataView)(this.oTrans.EpiDataViews["OrderDtl"]));
this.edvOrderDtl.EpiViewNotification += new EpiViewNotification(this.edvOrderDtl_EpiViewNotification);
// End Wizard Added Variable Initialization
// Begin Wizard Added Custom Method Calls
this.epiButtonC1.Click += new System.EventHandler(this.epiButtonC1_Click);
SetExtendedProperties();
// End Wizard Added Custom Method Calls
}
[...]
private void edvOrderDtl_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))
{
view.dataView[args.Row]["LockPrice"] = 1.00d;
}
}
}