How to get all previous versions page contents of a publishing page using SharePoint Client Object Model 2010

How to get all previous versions page contents and other field values of a publishing page using SharePoint Client Object Model 2010?
Thanks,
Osmita

Hi Osmita,
Greetings.
Here are the links that helps you. It has code attached to it.
http://social.technet.microsoft.com/Forums/sharepoint/en-US/a0d2ab40-99ba-4368-8505-1dc559ef6469/get-content-of-previous-version-of-page-sharepoint-2010?forum=sharepointgeneralprevious
http://social.technet.microsoft.com/Forums/sharepoint/en-US/faaf419f-997e-4150-9911-48cc375c3b46/how-to-get-previous-published-versions-of-publishing-pages-in-sharepoint-2010?forum=sharepointdevelopmentprevious
Please remember to click 'Mark as Answer' on the answer if it helps you

Similar Messages

  • Read versions of comments field using javascript client object model

    Hi,
     Does someone knows how to Read versions  of comments field in 'tasks' list using javascript client object model?
    Thanks
    Manvir

    Hi,
    According to your description, I know you want to read versions of comments field.
    We can use the
    SPServices to achieve it. The below code for your reference:
    $().SPServices({
    operation: "GetVersionCollection",
    async: false,
    strlistID: "tester",
    strlistItemID: 1,
    strFieldName: "comments",
    completefunc: function (xData, Status) {
    $(xData.responseText).find("Version").each(function(i) {
    console.log("Name: " + $(this).attr("Information") + " Modified: " + $(this).attr("Modified"));
    More information:
    http://spservices.codeplex.com/releases/view/81401
    Best Regards,
    Dennis Guo

  • I have just been told by Adobe that I have to UNINSTALL ALL PREVIOUS VERSIONS OF THEIR APPLICATIONS IN ORDER TO USE THE NEW 2014 VERSIONS.

    I have just been told by Adobe that I have to UNINSTALL ALL PREVIOUS VERSIONS OF THEIR APPLICATIONS IN ORDER TO USE THE NEW 2014 VERSIONS. No software update is worth the time it will take to do that!!!!! I don't know about the rest of you but I am woefully disappointed in Adobe. I pay on time every single month SINCE CREATIVE CLOUD BECAME AVAILABLE and now they place this on me? NOT HAPPY.

    THE LATEST AND THE LAST:
    Oh, and I'm on a MAC, not a PC so how could my database be corrupted?
    Shruthi: The caps.db file is located in Library/Application Support/Adobe/caps folder
    Shruthi: Can you try uninstalling from Adobe installers.
    Susan Meredith: You folks don't understand. Most of us are very excited at the new "bells and whistles" that Adobe has introduced and in the past we've been able to QUICKLY update to the new version. We haven't had to uninstall anything to get the new. We are all working and have deadlines. This is A HARDSHIP ON ADOBE'S USERS AND THEY NEED TO FIX IT ON THAT END. Or give up some monthly fees.
    Susan Meredith: There are many ways to uninstall. I can do it through "CleanMyMac". But now I don't trust that Adobe's programs will actually download and then I'm in trouble...and out of business.

  • SharePoint 2013 implement simple logout button which do not redirect to default sign out page using JavaScript client object model

    I am using windows authentication in my web application.
    My requirement is to implement a sign out button which will sign out the user without having him to close the browser and application should not ask him to login again.
    I tried following two options:
     1. Redirecting the user to default signout.aspx page " /_layouts/15/SignOut.aspx "
     2. Using "Sign In as a different user" URL " /_layouts/15/closeConnection.aspx?loginasanotheruser=true "
    In first case, user is redirected to default sign out page but he can press "Go Back to Site" link to revisit the site. Another major issue is that the user has to close the browser to sign out from the application completely, which is not desirable
    in my project requirement.
    In second case, the the current user is signed out of the application but if the user has saved the password in browser, he gets signed in automatically to the application.
    I also came across the solution where we replace the default sign out page with a custom sign out page, but I am not sure whether it can be implemented using JavaScript Client Object Model of SharePoint.

    Hi 
    I'm basically looking for the exact answer for the query.
    Meanwhile you need to go through the link mentioned below in order to understand how to do it.
    Debugging and Logging Capabilities in SharePoint 2010
    Indul Hassan
    Microsoft Community Contributor
    http://www.indulhassan.com
    You Snooze.. You Lose !!

  • CAML Query to get specific item in folder based on dropdown value using Javascript client object model

    Hi,
    I am using the Javascript Client object model.
    I have a custom list and a custom document library.
    Custom list contains 2 columns - dlName , dlValue
    The document library contains 2 folders - "folder1" ,  "folder2" and contains some images.
    The image name starts with the "dlValue" available in the custom list
    I am using a visual webpart and using javascript client object model.
    I am trying to achieve the below functionality:
    1) Load a dropdown with the custom list.
    2) set the image based on the value in dropdown.
    I have achieved the first option, I have set the dropdown, but not sure how to query the folder and set the image.
    Below is the code i have used so far:
    //In Visual webpart
    <select id="ddlTest" >
    </select>
    <br/>
    <div id="PreviewLayer">
    <img id="imgPlaceHolder" runat="server" alt="Image" title="imgPlaceHolder" src=" " />
    </div>
    // In Javascript file
    function RenderHtmlOnSuccess() {
    var ddlTest = this.document.getElementById("ddlTest");
    ddlTest.options.length = 0;
    var enumerator = this.customListItems.getEnumerator();
    while (enumerator.moveNext()) {
    var currentItem = enumerator.get_current();
    var dropdownValue = currentItem.get_item("dlValue");
    ddlTest.options[ddlTest.options.length] = new Option(currentItem.get_item("dlName"), dropdownValue);
    setImage(dropdownValue); // Not sure how to query the folder and set the image based on value.
    // Also if dropdown value is changed, corresponding image should be shown
    How to query the folder and based on dropdown value, show the image? Also, how to handle the dropdown value change?
    Thanks

    Hi,
    Here are two links for your reference:
    Example of how to Get Files from a Folder using Ecmascript \ Javascript client object model in SharePoint 2010
    http://sharepointmantra.wordpress.com/2013/10/19/example-of-how-to-get-files-from-a-folder-using-ecmascript-javascript-client-object-model-in-sharepoint-2010/
    SP2010 JSOM Client Object Model: How to get all documents in libraries including all folders recursively
    http://sharepoint.stackexchange.com/questions/70185/sp2010-jsom-client-object-model-how-to-get-all-documents-in-libraries-including
    In SharePoint 2013, we can also use REST API to achieve it.
    http://msdn.microsoft.com/en-us/magazine/dn198245.aspx
    Thanks,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Dennis Guo
    TechNet Community Support

  • Through SharePoint Client Object model, how to make color coded events on Sharepoint Calendar

    Hi,
    Through SharePoint Client Object model, how to make color coded events on Sharepoint Calendar.
    Plese share your knowledge.
    Regards
    Tharak

    Hi,
    According to your post, my understanding is that you wanted to make a color events Calendar.
    We can achieve it using the OOB method by creating the Calendars Overlay.
    http://summit7systems.com/color-code-calendar-events-in-sharepoint/
    You can also use the JavaScript to achieve it.
    http://spsawyer.wordpress.com/2013/07/18/sharepoint-color-calendar/
    http://www.planetwilson.co.uk/sharepoint-2013-colour-calendar-v2/
    more reference:
    http://usermanagedsolutions.com/SharePoint-User-Toolkit/Pages/Color-Coding-Calendar-List.aspx
    http://blog.pathtosharepoint.com/2010/04/06/tutorial-add-color-coding-to-your-sharepoint-2007-calendar-in-15-minutes/#comment-7231
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Cannot download master page using managed client object model SharePoint 2010

    string siteUrl = "http://server:port/sites/demo";
    string fileServerRelativeUrl = @"/sites/demo/_catalogs/masterpage/v4.master";
    using (ClientContext context = new ClientContext(siteUrl)){ FileInformation fileInfo = Microsoft.SharePoint.Client.File.OpenBinaryDirect(context, fileServerRelativeUrl);}
    File.OpenBinaryDirect() throws "The remote server returned an error: (404) Not Found" error. while Microsoft.SharePoint.Client.File f1 = web.GetFileByServerRelativeUrl(fileUrl);
                    context.Load(f1);
                    context.ExecuteQuery();this gives the file object.File.OpenBinaryDirect() works if I pass "/sites/demo/_catalogs/masterpage/TabViewPageLayout.aspx" as fileServerRelativeUrl.Both the files are present in Master Page Gallery.File.OpenBinaryDirect() doesn't work if I pass any of ".master" file in the master page galleryPlease let me know whether downloading the master pages is supported using managed Client object model. 

    Hi,
    If don't change the default config, We are unble to download master page.
    It's better to create your own (perhaps based on the default.master) and use that master page.
    also,make sure there's no a permission issue on the website.
    Thanks
    Guangchao chen
    TechNet Community Support

  • How to get the previous version of Flash professional?

    I need to install flash proffessional on 32 bit computer? How can I get the previous version as the Flash ProfessionalCC requires 64 bit?
    Many thanks for help.

    Hi Barbara,
    Flash Professional CS5.5 is a 32-bit application which can be installed on computers with either 32-bit or 64-bit operating systems.
    You can purchase this by Adobe's backward Licensing policy :
    " Adobe allows program members to order a current-version license but use a prior version. These members can contact Adobe Customer Service to request a serial number for the earlier version if they do not already have one. Prior-version software is available via ESD and can be purchased through standard resellers. The program member must follow all guidelines of the current-version EULA. "
    Please check the doc : http://www.adobe.com/volume-licensing/policies.html

  • Get current item id using JavaScript Client Object Model

    I have a client query that query SharePoint list Items. Lets say it is a document library. I need to get the list item id of each. 
    I can query the Title of the document using this syntax.
    ctx.CurrentItem['Title']
    But when I try 
    ctx.CurrentItem['ID']
    for list item ID, it does not give a value. How can I solve this?

    Hi Malin,
    If you're using the JavaScript Client Object Model, try using the SPListItem.get_item('key') method as in the example below:
    <script>
    ExecuteOrDelayUntilScriptLoaded(function(){
    var arrIds = [];
    var clientContext = new SP.ClientContext();
    var camlQuery = new SP.CamlQuery();
    camlQuery.set_viewXml('<View><Query></Query></View>');
    var items = clientContext.get_web().get_lists().getByTitle("Your List Title Here").getItems(camlQuery);
    clientContext.load(items);
    clientContext.executeQueryAsync(Function.createDelegate(this,function(){
    var itemEnumerator = items.getEnumerator();
    while(itemEnumerator.moveNext()){
    var itemId = itemEnumerator.get_current().get_item('ID');
    arrIds.push(itemId);
    alert(arrIds);
    }), Function.createDelegate(this, function(){
    alert("something went wrong");
    },"SP.js");
    </script>

  • I upgraded to firefox 4 but it is not suitable for my version of Mac Os and don't know how to get the previous version of firefox back!

    I downloaded the latest version of Firefox (ie 4) on my Apple laptop, but the fact that it is "unsuitable for (my version of) Mac Os " was not revealed to me until I had already replaced the previous version which was suitable. I don't know how to retrieve the version I was using.

    The latest versions of Firefox require at least Mac OS X 10.5 and an Intel processor. You can revert to Firefox 3.6.xx for Mac 10.4 by downloading the installer from http://www.mozilla.org/en-US/firefox/all-older.html
    More information in the [[Firefox will not start]] article, under
    [https://support.mozilla.com/en-US/kb/Firefox%20will%20not%20start#w_firefox-will-not-start-4on-os-x-10-4-or-earlier-or-with-a-powerpc-processorsf5on-windows-98me-or-earliersf Firefox will not start on OS X 10.4 or earlier or with a PowerPC processor]

  • How to delete a custom columns from a content-type in Sharepoint Client object model

    I have a windows interface where I create a content-type and then create a column and adds that column to the content-type.
    //availableCT is my content-type where the column is present.
    //get all available fields within this content-type
    FieldCollection fieldColl = availableCT.Fields;
    clientContext.Load(fieldColl);
    clientContext.ExecuteQuery();
    foreach (Field field in fieldColl)
    //columnFromList is the column that is to be deleted
    if (field.InternalName.Equals(columnFromList))
    field.DeleteObject();
    clientContext.ExecuteQuery(); // this throws an exception
    // Additional information: Site columns which are included in content types or on lists cannot be deleted. Please remove all instances of this site column prior to deleting it.

    hi,
    you can use the below code to delete it
    using (ClientContext sourceContext = new ClientContext(cmdSpoSite))
    Web web = sourceContext.Web;
    sourceContext.Load(web);
    sourceContext.Load(web.AvailableContentTypes, type => type.Include(c => c.FieldLinks, c => c.Name));
    sourceContext.ExecuteQuery();
    List<ContentType> ExistingContentType = web.AvailableContentTypes.ToList();
    IEnumerable<ContentType> contentTypesList = ExistingContentType.Where(ct => ct.Name == "<ContentTypeName>");
    ContentType ctype = contentTypesList.ElementAt(0);
    IQueryable<FieldLink> flinks = ctype.FieldLinks.Where(f => f.Name == "<FiledName");
    foreach (FieldLink flink in flinks)
    flink.DeleteObject();
    ctype.Update(true);
    sourceContext.ExecuteQuery();
    The difference being in your code and above code is you are removeing fileds which is eventually is deleting site column but a site column cannot be deleted if is alreday being used. So you need to deled the FieldLink in content type taht way column is removed
    from content type but not from site column.
    Now if you want to delete site column you can use your code to deleted Field.
    Whenever you see a reply and if you think is helpful,Vote As Helpful! And whenever you see a reply being an answer to the question of the thread, click Mark As Answer

  • Get current loggedin user using silverlight client object model SharePoint 2010?

    Hello,
    How can i get the current loged in user of sharepoint 2010 in silverlight4.XX  version by programtically in C#?
    Thanks
    Lovkesh Patel

    Hi,
    ClientContext clientContext = ClientContext.Current;
    clientContext.Load(clientContext.Web, s => s.CurrentUser);
    clientContext.ExecuteQueryAsync((sender, args) => {
    var currentUser = clientContext.Web.CurrentUser; }, null);
    For more information:
    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.web.currentuser.aspx and
    http://stackoverflow.com/questions/3441794/retrieve-current-user-login-in-sharepoint-from-a-silverlight-application
    Hope this helps you
    Senior Sharepoint Developer,STS [email protected]

  • How I can send emails using the client object model?

    I have tried this, but I always get an exception with error message "A recipient must be specified.":
    string webUrl = "http://sharepoint.example.com/";
    EmailProperties properties = new EmailProperties();
    properties.To = new string[] { "[email protected]" };
    properties.Subject = "Test subject";
    properties.Body = "Test body";
    ClientContext context = new ClientContext(webUrl);
    Utility.SendEmail(context, properties);
    context.ExecuteQuery(); // ServerException thrown here
    context.Dispose();
    Server stack trace:
    at System.Net.Mail.SmtpClient.Send(MailMessage message)
    at Microsoft.SharePoint.Utilities.SPUtility.SendEmail_Client(EmailProperties properties)
    at Microsoft.SharePoint.ServerStub.Utilities.SPUtilityServerStub.InvokeStaticMethod(String methodName, XmlNodeList xmlargs, ProxyContext proxyContext, Boolean& isVoid)
    at Microsoft.SharePoint.Client.ServerStub.InvokeStaticMethodWithMonitoredScope(String methodName, XmlNodeList args, ProxyContext proxyContext, Boolean& isVoid)
    at Microsoft.SharePoint.Client.ClientMethodsProcessor.InvokeStaticMethod(String typeId, String methodName, XmlNodeList xmlargs, Boolean& isVoid)
    at Microsoft.SharePoint.Client.ClientMethodsProcessor.ProcessStaticMethod(XmlElement xe)
    at Microsoft.SharePoint.Client.ClientMethodsProcessor.ProcessOne(XmlElement xe)
    at Microsoft.SharePoint.Client.ClientMethodsProcessor.ProcessStatements(XmlNode xe)
    at Microsoft.SharePoint.Client.ClientMethodsProcessor.Process()
    msdn link: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.utilities.utility.sendemail.aspx

    hi
    if you will check the code of SendEmail_Client(EmailProperties properties), you will find that it may only send emails to internal users. May be it was made intentionally in order to prevent spamming from client code. So let's see:
    internal static void SendEmail_Client(EmailProperties properties)
    if (properties.To.Count == 0)
    throw new SPException(SPResource.GetString(web.LanguageCulture, "SendEmailInvalidRecipients", new object[0]));
    AddressReader func = null;
    using (MailMessage mm = new MailMessage())
    func = delegate (MailAddress a) {
    mm.To.Add(a);
    ResolveAddressesForEmail(web, properties.To, func);
    new SmtpClient(SPAdministrationWebApplication.Local.OutboundMailServiceInstance.Server.Address).Send(mm);
    I.e. it adds recipient in ResolveAddressesForEmail() method. Now let's check this method:
    private static void ResolveAddressesForEmail(SPWeb web, IEnumerable<string> addresses, AddressReader func)
    if (addresses != null)
    foreach (string str in addresses)
    if (string.IsNullOrEmpty(str))
    continue;
    SPPrincipalInfo info = ResolvePrincipal(web, str, SPPrincipalType.All, SPPrincipalSource.All, null, false);
    if ((info != null) && (info.PrincipalId > 0))
    if (!string.IsNullOrEmpty(info.Email))
    try
    func(new MailAddress(info.Email, (info.DisplayName != null) ? info.DisplayName : "", Encoding.UTF8));
    catch (FormatException)
    continue;
    if ((string.IsNullOrEmpty(info.Email) && info.IsSharePointGroup) && web.DoesUserHavePermissions(SPBasePermissions.BrowseUserInfo))
    SPGroup byNameNoThrow = web.SiteGroups.GetByNameNoThrow(info.LoginName);
    if (byNameNoThrow == null)
    continue;
    foreach (SPUser user in byNameNoThrow.Users)
    if (!string.IsNullOrEmpty(user.Email))
    try
    func(new MailAddress(user.Email, (user.Name != null) ? user.Name : "", Encoding.UTF8));
    continue;
    catch (FormatException)
    continue;
    continue;
    I.e. at first it tries to resolve user using ResolvePrincipal() method. If it is not resolved (info == null) email is not sent. But if it is - it first checks that email is not empty. If it is not - it adds email to the MailMessage.To recipients list. If
    it is empty it checks whether the principal info represents Sharepoint group. If yes - it will send email to each member of the group.
    So it may be so that you try to send email to external user (which is not supported according to the code above), or resolved principal doesn't have email specified.
    Blog - http://sadomovalex.blogspot.com
    CAML via C# - http://camlex.codeplex.com

  • How to get a previous version of vyke freetxt for ...

    Hi there,
    i was using vyke freetxt (i dont know the exact version of it) happily till today when i deleted it by mistake. I went on and downloaded the new version (1.03) from vyke.com. There is something i hate in the new version. When i change the sim card, all the rigesteration information are wiped. I dont want this. I want the old version where the registeration information doesnt change when i change the sim card. This works fine with the old version (the one with green icon and not the current blue one.) which i am after. I cant download it from vyke.com. They only give the new version.
    Can anyone please find me the old version or lead to where i can download it?
    I really use vyke freetxt alot and i need this app very urgently.

    hi, i signed up from the link provided but I dont now know what to do... does it take some time for the application to be processed and do I get notified by email?
    I had thought an email would tell me either the hosted trial login details, or, some other instructions.... but i have nothing (other than verifying my email address)
    please advise
    thanks
    pete

  • How to access SharePoint External Data column using Silverlight Client Object Model

    Hi Friends,
    I have one sharepoint list which has column of type External Data type. My need is to access each item and get the values from the External Data Type column field.
    Can anyone help me how to acheive this. I am begineer in Silverlight.
    Thanks, Cool Developer

    Hi Friends,
    I have one sharepoint list which has column of type External Data type. My need is to access each item and get the values from the External Data Type column field.
    Can anyone help me how to acheive this. I am begineer in Silverlight.
    Thanks,
    RajanThanks, Cool Developer

Maybe you are looking for

  • Mail for Exchange - Calendar Alarms Problem

    Hi there, I have MfE working brilliantly, but there is one small issue that is bothering me. I also use PC Sync to syncronise with Outlook at home. Everything works fine, and I use Outlook at home to set up the majority of my appointments and these o

  • Need Help with DW 5.5 spry menu bars.

    I was given an unopened/registered Creative Suite 5.5 a couple days ago so I installed it and got to work on a website for my upcoming business. I got the home page finished, and so i saved it as a template to use for the remaining pages. But as soon

  • Problems with image and audio in Premiere

    Hi! I'm using Premiere Elements 9, but there's no synchronization with imagen and audio because the image is slower than audio and it's causing problems when I'm editing. Why can I do? It's there a poblem that can I fix in "Preferences" or is my lapt

  • Error during date comparing

    Hi , i have situation , where i have to find a date between two dates i used below filter condition, but i get error (TO_DATE(PLAYER_MONTHLY_SUMMARY.CURRENT_MONTH, 'DD-MON-YYYY') BETWEEN TO_DATE('01-MAR-2012', 'DD-MON-YYYY') AND TO_DATE('31-MAR-2012'

  • Help!! with a rollover conundrum!!

    I have a problem, i need to show four small icons for books my client wants to review on his website, and he wants some text to appear when you hover over any book. I can't for the life of me figure out how to set this up so that i can have the text