Sales Order Detail Field Read Only

Dear Experts,

When we are trying to set “Unit Price Field” Read Only in Sales Order -> Lines tab using Set Extended Properties method. It is not working refer to attached screen shot

Code:

public void InitializeCustomCode()
{
this.edvOrderDtl = ((EpiDataView)(this.oTrans.EpiDataViews[“OrderDtl”]));
this.edvOrderDtl.EpiViewNotification += new EpiViewNotification(this.edvOrderDtl_EpiViewNotification);

	SetExtendedProperties();
}

private void SetExtendedProperties()
{
EpiDataView edvOrderDtl = ((EpiDataView)(this.oTrans.EpiDataViews[“OrderDtl”]));
if (edvOrderDtl.dataView.Table.Columns.Contains(“DspUnitPrice”))
{
edvOrderDtl.dataView.Table.Columns[“DspUnitPrice”].ExtendedProperties[“ReadOnly”] = true;
}
}

Try setting the field DocDspUnitPrice.

Also, if you don’t want to code it, you can set it in Extended Properties Maintenance:

image

2 Likes

Thank you @hmwillett for helping me out. I really appreciate your kindness and support.