locked
CRM 2013 get option set value RRS feed

  • Question

  • Hi,

    Here resoultion time is option set and am trying to get the option set value..but it's not working

    can you pls suggest me on this

    var resolution = RetrieveCategroyNames[0].attributes["resolutiontime"] != null ? RetrieveCategroyNames[0].attributes["resolutiontime"].getSelectedOption().Value : "";


    Rammohan

    Wednesday, March 12, 2014 8:20 AM

All replies

  • Try

    RetrieveCategroyNames[0].attributes["resolutiontime"].Value


    Our Website | Our Blog | Follow US | My Facebook Page | Microsoft Dynamics CRM 2011 Application Design
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Wednesday, March 12, 2014 8:58 AM
    Moderator
  • Hi

    First i tried that way only it's not working


    Rammohan

    Wednesday, March 12, 2014 9:00 AM
  • Hi,

    Enable debugging in IE or where you feel comfort and excute RetrieveCategroyNames[0].attributes["resolutiontime"] statement in immediate window or console. You will get all the methods and extensions related to the object and you can exactly get what is code to use to get the value of it.

    Regards,

    Gopinath.

    mscrmtechie.blogspot.com


    Wednesday, March 12, 2014 9:10 AM
  • Give this code snippet a try

    var myOptionSet = Xrm.Page.data.entity.attributes.get("optionsetattributename");
     
    var optionSetValue = myOptionSet.getValue();
     
    var optionSetText = myOptionSet.getText();

    Wednesday, March 12, 2014 9:12 AM
  • if this is C# you need to cast the object first:

    if (RetrieveCategroyNames[0].attributes["resolutiontime"] != null) {
        var resolution = ((OptionSetValue)RetrieveCategroyNames[0].attributes["resolutiontime"]).Value;
    }


    My blog: www.crmanswers.net - Rockstar 365 Profile

    Wednesday, March 12, 2014 9:13 AM