0

我正在开发 Maximo Anywhere 7.5.2(工作执行应用程序)。我需要根据 Anywhere 中的某些条件过滤查找值。

例如:让我们考虑一下,我有只能具有 A 或 B 值的文本字段,如果它是来自 Maximo 的 A,则查找字段应显示 (P,Q,R,S),如果是 B,则查找应显示 (P ,Q) 只。

4

1 回答 1

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">
于 2016-02-17T17:09:43.470 回答