locked
Dialog query prompt-and-response option set

    Question

  • Is it possible to display a pre-defined option set in a prompt-and-response? I don't mean one where you enter the possible values in the query itself. I want to use an Option Set defined in the Customizations.

    I can see how I can query entity records but not option sets. I can also retrieve an entity that contains the option set, and limit the result set to a single column of that option set, but I can't specify "Distinct". The "Modify Query Variables" tab shows the Fetch query with distinct="false" but this does not seem seem to be editable. I also tried making a View but once again, I can't seem to specify Distinct.

    Thank you

    Friday, February 8, 2013 3:41 PM

Answers

  • I solved my problem:

    Although I had to re-create the option set locally (for the 50 states plus DC), I was able to update the CRM entity (Contact) directly, without having a conditional for each of those 51 possible values.  The trick is to set the user's response in the Prompt-and-Response to "whole number", and make the local option set values the same as the Contact's (or whatever entity's) analogous option set values.

    This worked perfectly.

    • Marked as answer by MeProgrammer Thursday, March 7, 2013 10:02 PM
    Thursday, March 7, 2013 10:02 PM
  • "Integer", not "whole number" - sorry for the mistake.

    No, Payman, the user clicks on the radio button or selects the option from the drop-down list of the selection he or she wants. The radio button has a text label (each of the States). It's the VALUE of that selection that gets saved and which you can use to update the option set on the Contact record.  Since the Data Type is fixed in the Prompt, I had to re-enter all the States in a new Prompt, with this new one set to "Integer" for the datatype.  See below for an illustration.


    • Marked as answer by MeProgrammer Friday, March 8, 2013 3:44 PM
    • Edited by MeProgrammer Friday, March 8, 2013 3:47 PM addendum
    Friday, March 8, 2013 3:44 PM

All replies

  • Is it possible to display a pre-defined option set in a prompt-and-response? I don't mean one where you enter the possible values in the query itself. I want to use an Option Set defined in the Customizations.

    I can see how I can query entity records but not option sets. I can also retrieve an entity that contains the option set, and limit the result set to a single column of that option set, but I can't specify "Distinct". The "Modify Query Variables" tab shows the Fetch query with distinct="false" but this does not seem seem to be editable. I also tried making a View but once again, I can't seem to specify Distinct.

    Thank you.

    (This question was also posted in the CRM Development forum, sorry for the dupe)

    Friday, February 8, 2013 3:45 PM
  • To the best of my knowledge, defined (global or local) option sets could not be used in dialog. If you try to use a query and then use it in your option set you have some issues. The "distinct" is not supported in fetch xml! It is only supported for count(distinct). Moreover, you could not edit the fetch xml of a query. You could only modify the variables.

    The only way could help you, is to build a view to only show the desired number of records (equal to distinct option set options)! To build such a view you could set some conditions to your option set.


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

    Saturday, February 9, 2013 7:55 AM
    Moderator
  • Thank you for replying, Payman.  I already tried to create a View but ran into the same problem. But there is another problem: since I couldn't use an already-existing option set, I created a local one and tried to use the item selected there to Update the Contact record's option set field of the same type and that could not be done either. The architecture simply doesn't allow it.
    Saturday, February 9, 2013 2:39 PM
  • What do you mean of "local" option set? The option set created for an entity? Or option set created in a dialog?

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

    Saturday, February 9, 2013 3:08 PM
    Moderator
  • By "local" I mean within the dialog.
    Monday, February 11, 2013 9:38 PM
  • Why your local option set did not update the desired entity? You have to insert a "check condition" for each value of the local option set, and then update your desired entity when the condition met! Hence, if you have an option set on you entity with 5 options, you have to insert 5 "condition checks". Hope this help you.

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

    Tuesday, February 12, 2013 8:08 AM
    Moderator
  • If my option set is, for example, the set of 50 states, that is inefficient and I was trying to find a better way.
    Tuesday, February 12, 2013 3:06 PM
  • If you find a solution, it is really appreciated if you share your knowledge here.

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

    Tuesday, February 12, 2013 6:52 PM
    Moderator
  • I solved my problem:

    Although I had to re-create the option set locally (for the 50 states plus DC), I was able to update the CRM entity (Contact) directly, without having a conditional for each of those 51 possible values.  The trick is to set the user's response in the Prompt-and-Response to "whole number", and make the local option set values the same as the Contact's (or whatever entity's) analogous option set values.

    This worked perfectly.

    • Marked as answer by MeProgrammer Thursday, March 7, 2013 10:02 PM
    Thursday, March 7, 2013 10:02 PM
  • The user should enter a whole number????

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

    Friday, March 8, 2013 6:18 AM
    Moderator
  • "Integer", not "whole number" - sorry for the mistake.

    No, Payman, the user clicks on the radio button or selects the option from the drop-down list of the selection he or she wants. The radio button has a text label (each of the States). It's the VALUE of that selection that gets saved and which you can use to update the option set on the Contact record.  Since the Data Type is fixed in the Prompt, I had to re-enter all the States in a new Prompt, with this new one set to "Integer" for the datatype.  See below for an illustration.


    • Marked as answer by MeProgrammer Friday, March 8, 2013 3:44 PM
    • Edited by MeProgrammer Friday, March 8, 2013 3:47 PM addendum
    Friday, March 8, 2013 3:44 PM
  • Long shot over 4 years on, did you get to write these values back into an entity using the dialog approach - How?

    Thanks


    Stuart

    Wednesday, September 20, 2017 11:58 AM