I need Non editable Field

Dear All,

In Purch Table , Field Name Purchstatus is Invoiced mean i need dont editable for the following fied from Purchline

Purchline.qtyordered and

Purchline.purchprice

Please help me , How declared from Farm lavel, I am already declared for

if (purchTable.PurchStatus != PurchStatus::Invoiced)
{
purchline_ds.object(fieldnum(Purchline,QtyOrdered)).allowEdit(false);
purchline_ds.object(fieldnum(Purchline,Purchprice)).allowEdit(false);
}

But allow edit, Kindly advice me

Thank You

(purchTable.PurchStatus == PurchStatus::Invoiced)
{
purchline_ds.object(fieldnum(Purchline,QtyOrdered)).allowEdit(false);
purchline_ds.object(fieldnum(Purchline,Purchprice)).allowEdit(false);
}

Hi Sakthi,

If you want to allow edit = false for fields from PurchLine (qtyordered and purchprice) when Purchase Order status is Invoiced, for that,

Ensure that these two form controls from Form design’s property (Auto Declaration should be set as Yes)

then, Instead of your codes,

if (purchTable.PurchStatus != PurchStatus::Invoiced)
{
purchline_ds.object(fieldnum(Purchline,QtyOrdered)).allowEdit(false);
purchline_ds.object(fieldnum(Purchline,Purchprice)).allowEdit(false);
}

Add below coding into PurchTable_ds.active() method:

Purchline_QtyOrdered.allowEdit(true); // form control
Purchline_Purchprice.allowEdit(true); // form control

if (PurchTable.PurchStatus == PurchStatus::Invoiced)
{
Purchline_QtyOrdered.allowEdit(false);
purchline_Purchprice.allowEdit(false);
}

Lot of Thanks Mr. Hussain