我正在使用Maximo Anywhere 7.5.2(工作执行应用程序)。我需要根据Anywhere中的某些条件过滤查找值。
Ex:让我们考虑一下,我的textfield只能有A或B值,如果是Maximo的A,那么查找字段应该显示(P,Q,R,S),如果是B,Lookup应该仅显示(P,Q)。
答案 0 :(得分:0)
这比您想象的要复杂,因为您需要编写自己的代码来执行以过滤后续查找。例如,您可以在WODetailHandler.filterAssetForLookup方法中查看此代码。
filterAssetForLookup: function(eventContext){
var additionalasset = CommonHandler._getAdditionalResource(eventContext,'additionalasset');
additionalasset._lookupFilter = null;
//save the current asset so we can reset it if the user has to revert the value
var workOrderSet = CommonHandler._getAdditionalResource(eventContext,"workOrder");
if(workOrderSet.getCurrentRecord() != null){
this.curAsset = workOrderSet.getCurrentRecord().get("asset");
this.curAssetDesc = workOrderSet.getCurrentRecord().get("assetdesc");
this.curAssetld = workOrderSet.getCurrentRecord().get("assetld");
}
var siteid = CommonHandler._getWorkorderSiteId(eventContext);
if(siteid == null){
siteid = UserManager.getInfo("defsite");
}
var filter = [];
filter.push({siteid: siteid});
additionalasset.lookupFilter = filter;
},
然后将此过滤器附加到app.xml中的filterMethod中。
<lookup filterClass="application.handlers.WODetailHandler" filterMethod="filterAssetForLookup" id="WorkExecution.AssetLookup" label="Select Asset" resource="additionalasset">