locked
Including an End Date within an Option Set RRS feed

  • Question

  • Is it possible to add an End Date to an option Set value in order to remove that option from the list?

    In our non CRM applications, all reference data includes an end date, and when we display data from the reference table, we only include items that do not have an end date in the past.  We use this to ensure records with old reference data remain accurate while stopping people accidentally using an old reference value.

    From my understanding, the only way to do this would be via a Custom Entity which includes the value and an end date, and then to use a look-up field which takes the end date into account.

    Any other options?

    Thursday, February 28, 2013 9:31 AM

Answers


  • From my understanding, the only way to do this would be via a Custom Entity which includes the value and an end date, and then to use a look-up field which takes the end date into account.

    As you wrote, the solution is to use a custom entity, will not require coding to add/update the value/date of the entries, and few lines to manage the past date requirement in CRM user interface or a custom application.



    Thursday, February 28, 2013 9:37 AM

All replies


  • From my understanding, the only way to do this would be via a Custom Entity which includes the value and an end date, and then to use a look-up field which takes the end date into account.

    As you wrote, the solution is to use a custom entity, will not require coding to add/update the value/date of the entries, and few lines to manage the past date requirement in CRM user interface or a custom application.



    Thursday, February 28, 2013 9:37 AM
  • You could set a javascript on the entity you want. Then check the date, if it reaches some value, remove some options of an option set. To remove the options use this:

    var optionsetControl = Xrm.Page.ui.controls.get("field name");

    optionsetControl.addOption(options[i]);


    If the answer helped you, remember to mark it as answer.

    Thursday, February 28, 2013 1:29 PM
    Moderator