Filter Search Dialog

Hi, I have an action which will execute a client side method to trigger the Search Dialog popup for an ItemType . See the sample code below. var topWnd = aras.getMostTopWindowWithAras(window); aras.modalDialogHelper.show('SearchDialog', topWnd.main || topWnd , params) How can i filter the results which are displayed in the search dialog popup? I know that, there is a way to predefine the filters using the client side event 'onSearchDialog', but in my case i cannot use that event directly, as i am triggering the search dialog popup from a client side method, not from a property.
  • Hi Dharmatej34,

    I ran into the same use case myself recently, but was unable to find a solution. Since my use case only had a few options to display (not potentially hundreds), I used a custom populated dropdown field as a workaround. In this method, you can see how I populated dropdown lists with the Locations and Parts related to a Process Plan.

    Hope this helps! If we do figure out how to pass an idlist or search parameters, we'll definitely make it a blog topic.

    Eli


    Eli Donahue

    Aras Labs Lead Engineer

  • Hi Eli,

    Any updates on this subject?! I have very similar dilemma at the moment.

  • Hello,

    This is possible using two optional parameters that you can pass into your Search Dialog when you open it programmatically. These are sourceItemTypeName and sourcePropertyName. When you use these two parameters, Aras Innovator will check to see if there is an onSearchDialog event on the property you specify. If so, it will call that event when you open your Search Dialog programmatically.

    For instance, if I have an onSearchDialog event defined on the owned_by_id of Part, I can call the event even when I open my search dialog from a method by defining my parameters like the sample below.

    var param = {
    aras: top.aras,
    type: 'SearchDialog',
    dialogWidth: 700,
    dialogHeight: 450,
    itemtypeName: 'Part',
    sourceItemTypeName: 'Part',
    sourcePropertyName: 'owned_by_id'
    };

    You can find a general description of what all of these parameters are in our blog post on standard dialogs in Aras Innovator. Additionally, you can check out our blog post on applying a filter to a search dialog for help writing the actual method. 

    Chris

    Christopher Gillis

    Aras Labs Software Engineer