有个需求需要在新增单据时候,指定字段必填,不能为空,我们可以在dep编辑界面扩张定义中,增加后置脚本,具体如下:
如上即可,获取界面控件值,这里我们限制的是采购人员字段,即F7类型,prmtPurchaseOrgUnit为控件名,getText()获取的是F7的编码,getValue()获取的是F7中显示在input框里的值
var purchasePerson = pluginCtx.getKDBizPromptBox("prmtPurchasePerson").getValue(); var purchaseOrgUnit = pluginCtx.getKDBizPromptBox("prmtPurchaseOrgUnit").getText(); var purchaseOrgUnitName = pluginCtx.getKDBizPromptBox("prmtPurchaseOrgUnit").getValue(); if(purchaseOrgUnit =="NM20" && purchasePerson ==null){ com.kingdee.eas.util.client.MsgBox.showInfo("当前组织为【"+purchaseOrgUnitName+"】,采购员不能为空!"); com.kingdee.eas.util.SysUtil.abort(); }
标签:控件,必填,pluginCtx,为空,var,getKDBizPromptBox From: https://www.cnblogs.com/ketoli/p/17631105.html