locked
Lookup views: Disable the view selector with JScript? RRS feed

  • Question

  • Hi there,

    I am currently using JScript to change the view of a lookup based on different conditions. However users wuold still be able to change the view by selecting another view from the View dropdown in the lookup view dialog box.

    I'd like to disable that dropdown. I tried turning the view selector off in the lookup field properties, but that effectively breaks the JScript, since it the view would always default to the predefined view.

    Any ideas on how I can achieve the desired result?

    Thanks in advance.

    Regards,

    P.


    MCC, MCT, MCP, MCTS
    If you find this post helpful then please "Vote as Helpful". If I helped you with an answer to a question then please "Mark As Answer".

    Tuesday, June 5, 2012 3:05 PM

Answers

  • Try this:

    document.getElementById("territoryid").disableViewPicker = 1;
    

    Jason Lattimer

    Tuesday, June 5, 2012 3:12 PM
    Moderator

All replies

  • Try this:

    document.getElementById("territoryid").disableViewPicker = 1;
    

    Jason Lattimer

    Tuesday, June 5, 2012 3:12 PM
    Moderator
  • Brilliant and simple... 

    Just added it at the end of my script, after the setDefaultView function. Works like a charm!

    Thanks again for the help!

    Cheers,

    P.


    MCC, MCT, MCP, MCTS
    If you find this post helpful then please "Vote as Helpful". If I helped you with an answer to a question then please "Mark As Answer".

    Tuesday, June 5, 2012 3:20 PM