Simple search not working on dynamically setting search value for Activity2 Itemtype?

Hi Team,

I have Item A and have "Activity2" relationship Item. I m setting search value for one of the field in Activity2. On clicking of search it not working.

Following is way I am setting field search value

//Setting filter value in search dialog box
var Filter = {};
Filter["proj_num"] = { filterValue: 1333|1393, isFilterFixed: false };
return Filter;

proj_num is one of the OTB field in form

But if I Manually search with same value(1333|1393) it give result.

I don't know what is going wrong. Any one please can help me out of this?

Thanks in advance

Parents Reply Children
  • Hi Christopher,

    I tried filter by AML option and below is my code 

    var AMLQuery = "<Item type='Activity2' action='get'><or><and><proj_num>1393</proj_num></and><and><proj_num>1333</proj_num></and></or></Item>"

    inArgs.QryItem.item.setAttribute("idlist", idlist);

    return;

    But still its not working.

    Thanks & Regards 

    Gaurav Bhagwatkar

  • Hi Gaurav,

    I'm not 100% sure about the case sensitivity, but I believe the nodes of boolean operators like <OR>, <AND>, and <NOT> need to be capitalized. In addition, the <AND> tags in your AML are unnecessary in the current form of your query.

    Try replacing your AML query with the one below:

    var AMLQuery = "<Item type='Activity2' action='get'><OR><proj_num>1393</proj_num><proj_num>1333</proj_num></OR></Item>";

    As a general tip, I like to test the AML query I'll be using when I need to include a raw query like this in a method. You can use the built-in Nash application in your Innovator instance to test this query and make sure that it's returning the items you would expect. The first section of our blog post on AML covers how to access Nash.

    Secondly, when you're loading in AML like this as a filter, you'll want to use the code below instead of setting the idlist.

    inArgs.QryItem.loadXML(AMLQuery);

    Chris

  • Hi Christopher,

    Thank you for replying.

    I tried making tags capital but still due to some reason its not working.

    Finally I end up writing following code and it resulted output I required.

    //Getting Id's of Item that required using some logic
    var IDs = "6C8BA60B1D784925BEA21D234312EDD8,EF95B584FB5F46C5A6C38794A03653F8" 

    //Getting values in array
    var tempArray = IDs.split(',');

    //Binding result to search dialog
    inArgs.QryItem.item.setAttribute("idlist", tempArray);

    Hope this help to others struggling from same problem.

    Thank you once again Christopher for every help and quick response

    Thanks & Regards

    Gaurav

  • I know this is an old thread, but please be aware if you specify the idList attribute it ignores any additional properties you set.