![]() |
#1 |
Участник
|
Microsoft Dynamics CRM Team Blog: Like-Unlike for Activity Feeds
Источник: http://blogs.msdn.com/b/crm/archive/...ity-feeds.aspx
============== Activity Feeds solution has been on the marketplace since late last year. With an upcoming UR, we are adding new cool features including filters, ability to set a default view and of course like-unlike. In this post we’ll walk through the like-unlike feature and SDK how-to. If you’d like a quick refresher on the SDK, try this post. There is also sample code up on MSDN. Social networks have set somewhat of a standard to quantify the popularity of posts. Facebook has the like button, Google+ uses +1. This system encourages users to participate actively as well get a feel of the response to content that they have created. Overall, it gives the feeling of being part of a community. Expressing this is quick, usually with the click on a single button and feedback is represented along with the content of the post itself. Like-Unlike inches the social experience in CRM closer to what users are already familiar with through other networking services. Hovering over a post typically shows at least one button, viz., Comment. Now, you’ll see a new ‘Like’ button like so: ![]() Clicking it likes a post and changes the button text to ‘Unlike’. The content below the post text now indicates that you’ve liked this post: ![]() When another user views this post on their wall, they see something like this: ![]() The like count obviously reflects the number of people that like it. Clicking the number displays the names of people who like this post in a popover: ![]() The Windows Phone app has this ability too: ![]() The smiley icon in the left bottom corner likes a post. Like-Unlike works the same way whether you are on your personal wall, on an entity’s wall on an entity form, even on read-only forms. A user can like-unlike all posts irrespective of how they’ve been created- by other users, by workflows or rule triggered auto-posts. A user will require the same permissions that they need for Activity Feed post or comment creation. There is SDK support as well. The following code snippets show how you can like a Post and retrieve user’s full names who like a particular post. Like a post with a particular Id var postLike = new PostLike { PostId = new EntityReference(Post.EntityLogicalName, post.Id) }; Guid likeId = _serviceProxy.Create(postLike); Console.WriteLine("Post with Id :{0} liked.", post.Id); Retrieve list of likes for a particular post string retrieveLikesFetchXml = "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + ""; var fetchExpression = new FetchExpression(retrieveLikesFetchXml); var likes = _serviceProxy.RetrieveMultiple(fetchExpression); Console.WriteLine("{0} users like this post. They are:", likes.Entities.Count); foreach (var entity in likes.Entities) { Console.WriteLine(entity.Attributes["fullname"]); } Since the aim of Activity Feeds is to encourage communication, there is no way to ‘dislike’ a post. For the same reason, you cannot like or unlike a post via workflows. Aniket Naravanekar <a href="mailto:anikna@microsoft.com"anikna@microsoft.com/a> Источник: http://blogs.msdn.com/b/crm/archive/...ity-feeds.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
|