Hide pick list-value RRS feed

  • Question

  • Hi

    Im using the following script to hide options from a piclist. 
    It works great in one of our oragnisations but not antoher one. Both of them is CRM 2013. 
    Anyone know why??


    function hideoption()


    var status = Xrm.Page.data.entity.attributes.get("stc_autogiro_status").getValue();

    if (status == 1) 



    Wednesday, October 1, 2014 9:21 AM

All replies

  • Hi Filfr,

    Check whether Option set Values are correct for this organisation.

    For different organisations Option set Values are different.

    your code looks fine. Debug your code and check whether it's entering the If condition.



    • Edited by Mohd Saad Wednesday, October 1, 2014 9:41 AM added clarification
    Wednesday, October 1, 2014 9:28 AM
  • Thank you. 

    The option set values is exactly the same, we have used the same solution and import it from the first organisation. 

    I have also debuged the code and it entering the If-condition so im really lost about this. 


    Wednesday, October 1, 2014 9:50 AM
  • Hi Filip,

    I tried your code in my environment and it runs fine. Please recheck your option set values of field stc_autogiro_status.

    My rollup version is UR 3.


    • Edited by Mohd Saad Wednesday, October 1, 2014 10:05 AM added rollup
    Wednesday, October 1, 2014 10:04 AM
  • Hi ,

    ur code seems to be true. Also can you try the below code?

    var control = Xrm.Page.ui.controls.get("stc_autogiro_status");

    Polat Aydın Crm Software Developer

    Wednesday, October 1, 2014 10:25 AM
  • please check if the  schema name of the attribute "stc_autogiro_status" is the same in both the environments.
    Wednesday, October 1, 2014 1:18 PM
  • Thanks. 

    Suddenly it started do work without any customizations.   And i have no idea wyh :) 

    Thursday, October 9, 2014 12:59 PM