For Quoted Quotes, we want to be able to edit some of the fields. We have the Company Entry → Sales Module → “Prevent changes” to Quoted Quotes enabled; we don’t want to edit most fields if this is checked. However there are some fields we do want to allow editing on, eg %confidence.
I’ve tried enabling a field we want to edit with code, but stays read-only. Can someone point me in the right direction? My code:
private void edvQuoteHed_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
EpiDataView edv = (EpiDataView)this.oTrans.EpiDataViews["QuoteHed"];
EpiCheckBox chkQuoted = (EpiCheckBox)csm.GetNativeControlReference("ae1717bb-1bb2-47f1-ac15-e9e8511080fe");
EpiTextBox txtConfPct = (EpiTextBox)csm.GetNativeControlReference("aa66eb67-ac55-4027-87a4-93a28239541b");
bool isQuoted = false;
if (edv.Row >= 0) { //-1 for empty form
isQuoted = Convert.ToBoolean(edv.dataView[edv.Row]["Quoted"]);
}
if (isQuoted) {
//MessageBox.Show("enabled!");
txtConfPct.ReadOnly = false; //Enable field even if quoted
txtConfPct.Enabled = true; //Enable field even if quoted
}
/* default code from wizard, unused */
if ((args.NotifyType == EpiTransaction.NotifyType.AddRow))
{
if ((args.Row > -1))
{
}
}
}
I want this field to be editable:
I’m thinking the readonly is set by the database field, not the interface… not sure how to get to that.
FYI… We like to have the Company Entry → Sales Module → “Prevent changes” to Quoted Quotes. Prevents accidental changes to important things like parts, price, etc (most fields). However, this prevents ALL changes to everything. There are some fields we’d like to allow editing even if quoted, eg % confidence, close out tasks. So currently we’re having to uncheck Quoted, make those changes, then recheck. This then resets the quoted date and other dates, which we don’t want for these types of changes.