Get user detailed activity on Documents in Sharepoint 2010 - c#

I currently have a client that needs to generate a report on the user's changes on the documents on every Document Library on every site collection.
I know I can use the Audit module OOB, but it doesn't show enough detailed data on the changes made on each item.
I was thinking about the detailed version history on the documents, but I would have to populate through every item of every list on every site collection. Something like this.
I was thinking about doing a custom page that combines both. I can filter the audit info of a particular user on a particular date range, and use the ItemId to get it's versioning details up to the audit date.
What do you think? could that be possible? is there a better way?
Thank you!

I recommend you develop a EventReceiver implemented in sitecollection level, so you can save "custom-made" any changes in elements of lists or libraries. So you can have your custom audit log in alternate database.
See also: http://msdn.microsoft.com/es-ec/library/ee231563.aspx
The EventReceiver is a good feature to keep high control in SharePoint Functionality.
Sorry for my bad english.

Related

Recognize record created from outlook/email in plugin

I'd like to perform some operation in mscrm plugin, if a new record is created automatically by CRM client for Outlook. Eg. it can be a contact or an incident created from an email.
Is there way to check this condition?
We have contact's first name and last name filled oppositely and incident without the caseorigincode field filled, when created from an email in Outlook. Maybe there is a better workarround to solve these two issues. But still I am wondering about the original question.
According to the sources available online, there is really no reliable way to solve this.
There was property CallerOrigin until CRM 4. Then it got deprecated, but continued working for some time, as state in another answer (https://stackoverflow.com/a/14812885/1474519). But it doesn’t seem to be working anymore in CRM 2015.
I found couple advices with IsExecutingOffline and IsOfflinePlayback, but it is really not solving the problem.
I also found a tip to check this code HttpContext.Current.Request.Url.ToString();. This doesn’t work for me.
I found the most complete information here: http://blog.simpletrees.com/2012/03/executioncontextcallerorigin-in.html
According to this article, I am sending a value in a hidden field from my form (or thru API, from plugin, from workflow). As this field is not set when a record is created from outlook, I can recognize the record being created from Outlook. There is of course problem, this field might not be set when importing records or when using mobile app. But I don’t see a better way to go.
Therefore, I started request on Microsoft Connect to add this functionality. You can vote for it here: https://connect.microsoft.com/dynamicssuggestions/feedback/details/1776771
You could add an attribute to the contact and incident to save the origin of the creation.
Then you add a plugin that listens to the Create event of the entities and register it only for client side (offline) execution.
Or you check the PluginExecutionContext for the IsExecutingOffline and IsOfflinePlayback properties to check if the creation was initiated from outlook and store the appropriate value.
https://msdn.microsoft.com/en-us/library/microsoft.xrm.sdk.ipluginexecutioncontext_members.aspx

Search engine optimization for database loaded using jQuery

I am currently optimizing my site for search engines. It is mainly a database driven site. I am using C# on the back end but database content is loaded via jQuery ajax and a web service. Therefore, my database content is not in html at the point that the bots will crawl it. My site is kind of like an online supermarket format in that there are thousands of items in my database, users can load a single one of these or more onto the web page at a time and the page does not change significantly once items are loaded.
My question is, how (if at all) can I get my database contents indexed? I was thinking of having an anchor that links to an aspx page (eg called mydatabase) which loads all of my database items as a big html list. Then, using jQuery, I would make the anchor invisible to users. The data would still be accessible to users but not by this link, it would be accessed by using the jQuery interface I have created.
The thing is, I don't really want users to see this big, messy list - would google results show this page eg www.mysite.com/mydatabase.aspx as a search result? Also would google see this as "keyword rich" spam page? I have done quite a lot of research but found nothing on this. only instructions for php. Please help I'm not sure what to do and need to know the best way to go about this.
It's a shame you haven't taken the progressive enhancement approach as it would mean you would have started with a standard HTML output that's crawlable, and then adding the layering behaviour (AJAX) on top for the user experience.
Providing a single file (e.g. mydatabase.aspx) that lists all of your products in a list format provides no real value for the reason you gave - it would just be a big useless list. No editorial content relevance for each link etc.
You're much better off taking another look at your information architecture and trying ensure that each product is accessibile by it's own unique URL, then classifying the products into groups (result pages), being careful to think about pagination.
You can still make this act like a single-page application using AJAX, but you'd want to look into HTML5's History API to achieve this in a search engine friendly way.

Dynamics CRM 2011 - Custom form with duplicate checking

I need to create a custom opportunity form which will almost mirror the out of box one but would like to add a section for checking duplicate records.
The overall goal is that when the form is filled out that section should populate with possible duplicate records to merger with.
I know there is out of box duplicate checking but not sure if it can be implemented this way.
Thanks,
Jon
You should be able to build a Web Resource in an IFrame that uses javascript to call the RetrieveDuplicatesRequest message. Here's a link that should help:
http://crm-edinburgh.com/2011/08/crm-sdk-using-detect-duplicates-settings-in-code/
This assumes that you already have Duplicate Detection set up and running.

See document in list without opening it in SP2010

is it possible in Sharepoint 2010 set a permission on a document in order to allow a specific user to view this document (when viewing the documents of a specific document library for example) without giving him the privilege to open it?
For example, [user1] can see that in the list of documents of document library [DocLib1] there is a document called [doc1.docx], but [user1] doesn't have the permission to open[doc1.docx] and view its content.
Technically raymund's answer is obscurity instead of security. If you are going to go that route you can simply update your primary view to remove any links to the document. and create a seperate view for those authorized.
Edit***
after double checking msdn, I found the user permissions article. This shows that there are in deed two seperate permission levels - view items and open items. unfortunately view items is dependent upon the open items permission level, therefore unable to really accomplish your goal.
http://technet.microsoft.com/en-us/library/cc288074.aspx
You can do this by creating a SOAP Service Connection in Sharepoint Designer
Then using your Document List as the source (declaring a login on the login tab with a privilage to tread the list) , then displaying it as a dataview in a sharpoint form.
I have a similar sample here which has a better explanation using a list instead (I should work the same with document library as they are exposed both as lists).

SharePoint most clicked links

I am trying to make a web part that will display what links got clicked/viewed the most across the whole site collection. These links come from a SharePoint list.
Is there a mechanism in the object model that can be used to accomplish this?
Any thought would be helpful.
If the links all go to SharePoint pages within your portal, then you might be able to gather the information in your Site Usage Report, then query that in a custom web part. If the links point to places outside your portal, I am not aware of any out-of-the-box record of which links are getting clicked on in a SharePoint list. You could possibly make some javascript to add special code to the list interface so that, whenever a link is clicked, it first records to a database, then takes the user to the destination.

Categories