0

我想在采购申请中插入新产品并编辑采购价格,但该字段是只读的。

我尝试解锁 PurchReqTable 表单中的字段,但它已经被锁定。

我试图找到一些锁定字段的运行时方法,但我不走运。

任何的想法?

4

1 回答 1

1

查看 PurchReqTable 表单中的以下方法:

void setFieldAccess()
{
    boolean allowEdit = purchReqFormMode == PurchReqFormMode::ShowAll ||
                        purchReqLine.LineType == PurchReqLineType::Category ||
                        isUserTaskOwner ||
                        isUserApprovalOwner;
    ;

    purchReqLine_ds.object(fieldnum(PurchReqLine,PriceUnit)).allowEdit(allowEdit);
    purchReqLine_ds.object(fieldnum(PurchReqLine,PurchUnit)).allowEdit(allowEdit);
    purchReqLine_ds.object(fieldnum(PurchReqLine,PurchPrice)).allowEdit(allowEdit);
    purchReqLine_ds.object(fieldnum(PurchReqLine,LineDisc)).allowEdit(allowEdit);
    purchReqLine_ds.object(fieldnum(PurchReqLine,LinePercent)).allowEdit(allowEdit);
    purchReqLine_ds.object(fieldnum(PurchReqLine,PurchMarkup)).allowEdit(allowEdit);

    purchReqLine_ds.object(fieldnum(PurchReqLine,CurrencyCode)).allowEdit(purchReqLine.RecId != 0);
    purchReqLine_ds.object(fieldnum(PurchReqLine,LineAmount)).allowEdit(!purchReqLine.isCatalogItem());
}

注意如果当前行包含非目录项,LineAmount 是如何被禁用的。更改数据源或表上的设置将在运行时被此代码覆盖。我希望这有帮助。

于 2012-08-07T23:18:46.163 回答