Preselect Effective when users open document

Can anyone tell me how can i preselect Effective on documents when user opens the search grid as can be seen below

  • Do you want to do this for all items types or just for Documents? Maybe you can modify ..Client\javascript\search_mode.js in the codetree .

  • Hi i want this only for documents

  •  , I am attempting to do a similar thing --> preselect 'Released' when users open the search grid.  I followed your suggestion WRT modifying ..Client\javascript\search_mode.js, but was unable to find success.  Could you perhaps provide a little more insight?

  • Happy new year!

    The post is quite old. In the past these kind of grid elements were rendered by codetree functions. In modern Innovator versions they were replaced by CUI components. For the query type rendering see Method "cui_svcb_querytype_init". 

    But I not sure if it´s wise to change search query type on a general level. Keep in mind that it affects all versioned ItemTypes!

    We have a similar scenario with one ItemType where we want users to mainly work with "Released" Documents.
    We right now use the "Save Layout" function and sell it as a "secret feature" during the training session :). 

    Angela

  • Hmmm, perhaps the Save Layout function could suffice....but, that would have to be setup individually on each user's account right?

  • Yes! It´s possible for admins to write custom settings into the individual user "Preferences". But people can still overwrite them later. Sometimes you have will to reset user Preferences for bug fixing reasons and of course need to update the stuff again. The AML query itself is not the easiest one. And each upgrade will probably enforce a reset of the preferences. It will be FUN!!! Do it and let me know your experience! Thanks! :)

    My previous tests with Preference overwrites never made in into production. That´s the reason why I right now embed it in the training. In our case changing the query type it´s more a recommendation, not a strict rule. 

    But just as I am writing this text I have a better idea:

    --> We can always replace the existing CUI elements with our own variants! 

    Make a duplicate of CUI element "searchview.commandbar.default.querytype" and use your own init Method. Using a custom element will overwrite the dropdown for the ItemTypes where you use it.

    Your init Method will be 99% identical. Don´t change the default list! Just select another init value in this code line:

    const queryTypeValue = aras.getPreferenceItemProperty('Core_ItemGridLayout', itemTypeID, 'query_type', 'Current');

    Maybe add some hints in the Method that it´s a duplicate from something else and why you do it.

    In theory you could also just modify the original Method to use a different default dropdwon value for your specific ItemType. But modifying OOTB Method is always messy in package exports and upgrades. 

    I haven´t tested it, but I expect it to be perfect!Sunglasses