2012-08-07 48 views
0

我想在采购申请中插入新产品并编辑采购价格,但该字段为只读字段。在动态轴上更改采购价格2009采购申请行

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

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

有什么想法?

回答

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被禁用。 在运行时,更改数据源或表上的设置将被此代码覆盖。我希望这有帮助。

+0

非常有帮助谢谢! – Klamore74 2012-08-08 07:31:00