Thursday, July 14, 2011

Saving the Picklist Value in CRM 2011 using javascript

Xrm.Page.getAttribute('picklistname').setValue(1);

Xrm.Page.data.entity.save();

Here I am selecting the element with the value 1.So corresponding Text value will be shown and the second line will save the value by calling save method.

Cheers!!

2 comments:

  1. Where do I implement this? I've made a pickList and put it on my Articles form, but I essentially want it to be available so that users who read the articles can decide if the article was helpful or not and click either Yes or No. Is there a way I first of all make the pickList dynamic so it's not set every time a user opens the article, and second, store my employee's answers somewhere so I can do analysis on my articles?

    Thank you for your time. As you can tell, I am just a beginning programmer and not very familiar with JavaScript or XML.

    ReplyDelete
  2. Hey Mikeac!

    I am really sorry for the late reply and thanks for commenting.

    Are you doing this in MS CRM or some website?
    If you are doing it in CRM then definitely I can help you in creating the picklist dynamically and setting the value as well.

    waiting for your reply.
    Thanks

    ReplyDelete