Filters

How can I filter on "system_number" not equal to "PDC*" and "state" equal to "DRMO" OR "Inactive" ///<SUMMARY> ///On select new delivered component as relationship, filter by System not equal to "PDC*" and  State equal to "DRMO or InActive" ///</SUMMARY> var retObj = new Object(); retObj["system_number"] != { filterValue: "PDC*", isFilterFixed: true }; ****** Need to make not equal to" ****** retObj["state"] = { filterValue: "DRMO", isFilterFixed: true };  ****** Need to include "InActive" ****** return retObj;
Parents
  • Hello, It does not appear possible to use a 'not equals' condition within a simple search. In regards to searching on a state of DRMO or Inactive, you can typically do this within a simple search by using a '|' character between your two criteria such as 'DRMO|Inactive'. However, there is a known issue when using a filter like this where the '|' is not properly escaped. With that being said, there are two potential workarounds for this issue.
    1. Perform a search using the Innovator API within the onSearchDialog event using your desired criteria. Parse these results and build an array of the IDs of the items that match your criteria. You can then set a filter using the idlist with a line like inArgs.QryItem.item.setAttribute("idlist",idArray.join(","));
    2. You can load the AML of your criteria directly within the onSearchDialog event. For example: inArgs.QryItem.loadXML("<Item type='MY_ITEMTYPE' action='get' page='1' pagesize='25' maxRecords=''><system_number condition='not like'>PDC%</system_number><OR><state>DRMO</state><state>Inactive</state></OR></Item>");
    Either of these workarounds should let you filter your items by your desired criteria. Chris
    Christopher Gillis Aras Labs Software Engineer
Reply
  • Hello, It does not appear possible to use a 'not equals' condition within a simple search. In regards to searching on a state of DRMO or Inactive, you can typically do this within a simple search by using a '|' character between your two criteria such as 'DRMO|Inactive'. However, there is a known issue when using a filter like this where the '|' is not properly escaped. With that being said, there are two potential workarounds for this issue.
    1. Perform a search using the Innovator API within the onSearchDialog event using your desired criteria. Parse these results and build an array of the IDs of the items that match your criteria. You can then set a filter using the idlist with a line like inArgs.QryItem.item.setAttribute("idlist",idArray.join(","));
    2. You can load the AML of your criteria directly within the onSearchDialog event. For example: inArgs.QryItem.loadXML("<Item type='MY_ITEMTYPE' action='get' page='1' pagesize='25' maxRecords=''><system_number condition='not like'>PDC%</system_number><OR><state>DRMO</state><state>Inactive</state></OR></Item>");
    Either of these workarounds should let you filter your items by your desired criteria. Chris
    Christopher Gillis Aras Labs Software Engineer
Children
No Data