Maximo Anywhere - 查找过滤器问题

Maximo Anywhere - Lookup Filter issue

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

例如:考虑一下,我的文本字段只能包含 A 或 B 值,如果它是 Maximo 中的 A,则查找字段应显示 (P,Q,R,S),如果是 B,查找应仅显示 (P,Q)。

这比您想象的要棘手,因为您需要编写自己的代码来执行以过滤后续查找。例如,您可以在 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">