How to get the version changes programatically in ItemCheckedin event

Hi,
I am creating a custom version history page.
I have a requirement were I have to capture the changes after file check-in and display it in the custom page.
Is there anyway to get the version changes programatically after the file has been checked-in?
Is is possible to get the current version and previous version in ItemCheckedin event
and get the version changes?
Thanks in advance,
dhijit

Hi,
As Dimitri said, we can use ItemCheckingIn event to achieve it.
The following code snippet for your reference:
public override void ItemCheckingIn(SPItemEventProperties properties)
base.ItemCheckingIn(properties);
int beforeLevel = (int)properties.BeforeProperties["vti_level"];
int afterLevel= (int)properties.AfterProperties ["vti_level"];
if((beforeLevel==255) && (afterLevel==1))
// This is a major version that is being checked in . . .
int majorVer= properties.ListItem.File.MajorVersion+1;
Best Regards
Dennis Guo
TechNet Community Support

Similar Messages

  • How to get the "last changed by" for a set of function modules?

    How to get the "last changed by" for a set of function modules?
    is there any table to get it??

    See [this|Re: Date of creation of function module] I posted earlier.
    >TFDIR will give you the name of the function group program and the include number.
    >E.g. SAPLZFUNCGROUP Include 01.
    >From this you can construct the include name: LZFUNCGROUPU01.
    >You can look this up in TRDIR to find the creation date (CDAT) of the function module.
    In your case, you need unam and udat.
    matt

  • How to get the version no. for service po?

    Hi,
    How to get the version no. for service po?For material po we are getting the version from EKKO-REVNO but for service po Ekko-revno is blank.
    Regards,
    Rachel.

    Hiee,
    It is not like service PO does not have revision.
    REVNO will only exists for any document if amendment is made after releasing it. If in EKKO for all service PO revision number is blank then test if version management is active for document type
    MM->Purchasing->Version management -> External documents
    Here check for your doc type and purchase org version management is active.
    Regs,
    Appie

  • How to get the version no of a document created/updated in KM

    Hi All,
    We are currently working on SAP 7.0 SP16.
    We have used the KM API to store our documents into the KM repositories.
    The problem we are facing here is related to the version no of the documents created.
    I will explain this with an example :
    I have created a document "test.txt" --> default version no is 1
    I updated the same twice now there are 3 version for this document 1, 2 & 3.
    Now if I delete the version no 1 then there are only 2 document versions remaining in the system, but the Portal still displays them as 2 and 3.
    Now when I want to read the version history of this document I get an IResource object for each version but I am not able to find any means through which I can retrieve the version no of the IResource object which is currently being read.
    Can someone please help me the information regarding how to retrieve the version no from the IResource object returned whenever a document is read using KM API.
    Thanks in advance!
    Regards,
    Manish

    Hi,
    try something like this:
    String strRevisionID = null;
    if (resource.isVersioned())  {
      IVersionHistory versions = resource.getVersionHistory();
      if (versions != null) {
        IResource version = versions.get(i);
        strRevisionID = actResource.getRevisionID();
    hope this helps,
    Romano

  • How to get the Version History of a stored document?

    Hi,
    I am trying to store and retrieve the content using Content Services features of ADEP 10.0.
    I am able to store and retrieve content where as I am not able to get the version of the document. I am trying to store same or different document, but I donot get the version history or version label. Please guide me how I can get  the version of a stored document.
    Also, please advise me if there are simple alternative to do the same in ADEP10.
    Please see below my sample code below:
    package test.sample;
    import java.io.File;
    import java.util.*;
    import com.adobe.idp.Document;
    import com.adobe.idp.dsc.clientsdk.ServiceClientFactory;
    import com.adobe.idp.dsc.clientsdk.ServiceClientFactoryProperties;
    import com.adobe.livecycle.contentservices.client.CRCResult;
    import com.adobe.livecycle.contentservices.client.impl.DocumentManagementServiceClientImpl;
    import com.adobe.livecycle.contentservices.client.impl.UpdateVersionType;
    public class AddContent {
        public static void main(String[] args) {
            try{
                //Set connection properties required to invoke Document Services in EJB mode                                
                Properties connectionProps = new Properties();
                connectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT, "jnp://localhost:1099");
                connectionProps.setProperty(ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,Service ClientFactoryProperties.DSC_EJB_PROTOCOL);          
                connectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE, "JBoss");
                connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, "administrator");
                connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, "password");
                //Create a ServiceClientFactory object
                ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);
                //Create a DocumentManagementServiceClientImpl object
                DocumentManagementServiceClientImpl    docManager = new DocumentManagementServiceClientImpl(myFactory);
                //Specify the store and node name
                String storeName ="SpacesStore"; 
                String nodeName = "/Company Home/Test Directory";
                //Retrieve the document to store in /Company Home/Test Directory
                Document contentA =  new Document(new File("C://Adobe/New files/Data-A.pdf"), false);
                Document contentB =  new Document(new File("C://Adobe/New files/Data-B.txt"), false);
                Document contentC =  new Document(new File("C://Adobe/New files/Data-C.xlsx"), false);
                //Create a MAP instance to store attributes
                Map<String,Object> inputs = new HashMap<String,Object>();
                //Specify attributes that belong to the new content
                String creator = "{http://www.alfresco.org/model/content/1.0}creator";
                String description = "{http://www.alfresco.org/model/content/1.0}description"; 
                inputs.put(creator,"Veeraganteppa Sajjan");
                inputs.put(description,"A sample application form");
                //Store MortgageForm.pdf in /Company Home/Test Directory
                CRCResult resultA = docManager.storeContent(storeName, 
                         nodeName,
                        "dataA.pdf",
                        "{http://www.alfresco.org/model/content/1.0}content", 
                        contentA,
                        "UTF-8",
                        UpdateVersionType.INCREMENT_MAJOR_VERSION,
                        null,
                        inputs); 
                CRCResult resultB = docManager.storeContent(storeName, 
                        nodeName,
                       "dataB.pdf",
                       "{http://www.alfresco.org/model/content/1.0}content", 
                       contentB,
                       "UTF-8",
                       UpdateVersionType.INCREMENT_MAJOR_VERSION,
                       null,
                       inputs);
                CRCResult resultC = docManager.storeContent(storeName, 
                        nodeName,
                       "dataC",
                       "{http://www.alfresco.org/model/content/1.0}content", 
                       contentC,
                       "UTF-8",
                       UpdateVersionType.INCREMENT_MAJOR_VERSION,
                       null,
                       inputs);
                //Get the identifier value of the new resource
                String idA = resultA.getNodeUuid();
                String idB = resultB.getNodeUuid();
                String idC = resultC.getNodeUuid();
                System.out.println("A -The identifier value of the new content is "+idA);
                System.out.println("B - The identifier value of the new content is "+idB);
                System.out.println("C - The identifier value of the new content is "+idC);
               System.out.println("A - The Browse Link is "+resultA.getBrowseLink());
                System.out.println("B - The Browse Link is "+resultB.getBrowseLink());
                System.out.println("C - The Browse Link is "+resultC.getBrowseLink());
              System.out.println("A-The Version Label is "+resultA.getVersionLabel());
              System.out.println("B-The Version Label is "+resultB.getVersionLabel());
              System.out.println("C-The Version Label is "+resultC.getVersionLabel());
              System.out.println("The Version History is "+docManager.getVersionHistory(storeName,nodeName, true));
        }catch(Exception e)
            e.printStackTrace();
    Message was edited by: V B Sajjan

    Sorry I did not attach the output and errors. Please find the same below.
    A -The identifier value of the new content is f5427f5b-c7c1-4c3c-b959-cb84e4e49a13
    B - The identifier value of the new content is b237d22c-5ff5-4628-a83a-23f5e49ae48e
    C - The identifier value of the new content is 34a9992c-3705-4488-bb55-6dd7ddfa0517
    A - The Browse Link is http://localhost:8080/contentspace/wcs/api/node/content/workspace/SpacesStore/f5427f5b-c7c 1-4c3c-b959-cb84e4e49a13/dataA.pdf
    B - The Browse Link is http://localhost:8080/contentspace/wcs/api/node/content/workspace/SpacesStore/b237d22c-5ff 5-4628-a83a-23f5e49ae48e/dataB.pdf
    C - The Browse Link is http://localhost:8080/contentspace/wcs/api/node/content/workspace/SpacesStore/34a9992c-370 5-4488-bb55-6dd7ddfa0517/dataC
    A-The Version Label is null
    B-The Version Label is null
    C-The Version Label is null
    ALC-CSV-30015-000: com.adobe.livecycle.contentservices.client.exceptions.CSInvocationException: ALC-CSV-030-015-The node [/Company Home/Test Directory] is not versioned.
    at com.adobe.contentservices.webscripts.impl.AbstractContentManager.doGetVersionHistory(Abst ractContentManager.java:1362)
    at com.adobe.contentservices.webscripts.impl.ContentManagerImpl.executeParams(ContentManager Impl.java:198)
    at com.adobe.contentservices.webscripts.impl.CSRetryingTransactionCallback.execute(CSRetryin gTransactionCallback.java:45)
    at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransacti onHelper.java:326)
    at com.adobe.contentservices.webscripts.impl.ContentManagerImpl.execute(ContentManagerImpl.j ava:114)
    at org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:333)
    at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransacti onHelper.java:326)
    at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContaine r.java:386)
    at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContai ner.java:404)
    at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java: 246)
    at org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:294)
    at org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:172)
    at org.alfresco.web.scripts.servlet.WebScriptServlet.service(WebScriptServlet.java:122)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at com.adobe.idp.um.auth.filter.CSRFFilter.doFilter(CSRFFilter.java:86)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.ja va:183)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)
    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEs tablishmentValve.java:126)
    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEst ablishmentValve.java:70)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java: 158)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.ja va:598)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451)
    at java.lang.Thread.run(Thread.java:662)

  • How To Get The Version Of Music Player Back?

    Welcome,,
    i have Nokia N8 and i install an update for music player and it is too bad and  not easy as the past version
    so is there a way to get past version back?
    Thanks,,

    there is no way to downgrade firmware, sorry.

  • How to get the Version of the Solution Manager

    Hi Experts,
    The Solution Manager is Already Insatlled on our Machine.
    How to Find out the Version of the Solution Manager???
    How to Disply the Solution Manager Key????
    Please give me the Proper Solution on this.
    Regards
    Khanna

    Hi,
    Check this link
    http://www30.sap.com/korea//services/pdf/Solman_4.0_Maintenance_Optimizer_Setup_Guide.pdf
    you might have to use t-code  SPRO
    Regards,
    Ramesh P
    Message was edited by:
            Ramesh Parashivamurthy

  • How to get the latest Change date and time of a M.O. from View VIAUFKST

    Hi All,
    I want to get the latest date and time of a M.O. from view
    VIAUFKST. I have written the query like this...
      SELECT AUFNR
             AEDAT  " Changed Date
             AEZEIT " Changed Time
        FROM VIAUFKST
        INTO TABLE I_VIAUFKST
       WHERE AEDAT >= W_LASTRUN_DATE
       ORDER BY AEDAT DESCENDING.
    but its not giving me right results... Pls help me out on this or suggest me the right approach to achieve the same...As this is very critical issue...
    Advance Thanks and Points Gauranteed...
    Suresh

    > SELECT AUFNR
    >          AEDAT
    >          AEZEIT
    >     FROM VIAUFKST
    >     INTO TABLE I_VIAUFKST
    >    WHERE AEDAT >= W_LASTRUN_DATE.  
    >
    >   IF NOT I_VIAUFKST[] IS INITIAL.
    >    SORT I_VIAUFKST BY AEDAT AEZEIT DESCENDING.
    >    READ TABLE I_VIAUFKST INDEX 1.
    >   ENDIF.
    >
    > The above statement is giving me different results...
    > such as...
    >
    >  1. 30/11/2005 19:20:11
    >  2. 29/11/2005 22:10:09
    >  3. 30/11/2005 20:56:09
    >  4. 28/11/2005 23:10:09
    >
    > by using the above SORT statement i am getting the
    > fourth record as the latest, where as it should give
    > me the third record....
    >
    > Please advise,
    > Suresh.
    Hi Suresh,
    The reason why you are getting this result is because the system is interpreting the DESCENDING only for AEZEIT not for both. Change it to
    SORT I_VIAUFKST BY AEDAT DESCENDING AEZEIT DESCENDING

  • How to get the version of the Document opened.

    Hello all,
    When a document is opened I want to know in which Indesign version this document was created.
    Depending on the version I need to route to different functions in my code.
    Is there a way to know this.
    Thank you
    Madhu

    Hi Madhu,
    have a look at iDataBase->GetVersionNumber
    Best,
    Peter

  • How to get the original query string in an event receiver when dialogs are enabled

    I have scenario where I am adding a document to a document library which has an external data column on it. My goal for this column is to have it automatically populated with an appropriate value based on original query string to the page. The general
    idea is that I am on a custom page that has various webparts on it including a view of my document library that is context sensative based on the query string, and I want to use that context sensitivity not just to filter the list but also when adding documents.
    I have been searching around for solutions to this problem all day and have gotten this far:
    I have an event receiver attached to my document library that handles the ItemAdded event syncronously (as such I have the new list item available to me). In that event receiver I am able to set the column values as required. Where I am stuck is on getting
    the value from the query string that I need to actually set as the column value.
    Based on:
    http://social.technet.microsoft.com/Forums/en-US/sharepoint2010programming/thread/8cfcb299-9a55-4139-86ec-0b53b2922a54 and several similar articles/posts I have been able to get the original source Url with the query string I want via the following
    code in my event receiver:
    private HttpContext context;
    public EventReceiver1()
    context = HttpContext.Current;
    public override void ItemAdded(SPItemEventProperties properties)
    var originalQueryString = context.Request.QueryString["Source"];
    // Parse the query string and use the value ...
    The problem is that this solution breaks down if the dialogs are turned on under the advanced settings for the list. The reason the solution fails is because the "Source" query string parameter goes away and is replaced by "IsDlg" set to a value of "1".
    Does anyone know how to get past this hurdle? Any help would be greatly appreciated.

    Hi Stuart,
    The reason I'm looking for "Source" in the query string is because that is something I found to be reliable when the Dialogs are turned off. I've dug around pretty deep in the Request object to see if anything had the data I was looking for and unfortunately
    it doesn't appear to be there. The
    context.Request.QUeryString.ToString()
    returns a rather simple one of:
    List=%7b43ECDCB0-8440-4652-B067-AA20481779D7%7d&RootFolder=&IsDlg=1
    and the
    context.Request.UrlReferrer.Query.ToString()
    has the same value.
    I suspect this is due to the dual step process that takes place in adding an item to a document library where the first modal popup (which I suspect likely has the information I need) gives you the opportunity to browse to your file and then the second
    dialog (maybe this is getting brought up as a result of another request which is now referring back to the original request that brought up the first dialog?) where you edit your properties.
    Thanks for the try though, if you've got anything else I'd love to hear it.

  • JTable problem : how to get the last value entered by user + event lost

    Hi all,
    I have 2 problems with Jtable class.
    1 => To get the last value entered by user in a cell,
    it seems that we must change the selected cell.
    That is to say we can only have the previous cell's value.
    Is there a simple way to get the current value of any cell ?
    2 => To resolve the problem i store the values of each cell in a vector and i intercept keyboard event (!)
    BUT, when i do a double click with the mouse on the Jtable, i loose keyboard events. Then, i can't intercept them.
    Is it a bug of swing or am i following a wrong way ?
    Thanks by anticipation for your help.

    You have to fire the "TableCellUpdatedEvent"
    and override the getCellEditorValue in TableCellEditor to return the current value

  • How to get the mode (change/display/create/edit) of a CRM WEBUI

    Hi,
    I have a table(custom) in my CRM WBUI ServiceContratc Page. Now I want to hide this table in create mode.
    Could you please let me know, how can I know in which mode I am on WEB UI(Like Create/Change/Display)
    Thanks,
    Aparna

    Hello,
    use below method to check whether view is editable/display mode ...
    me-->view_group_context->is_view_in_display_mode( me ). here "me" refers to the implementation class of view.
    Regards,
    Sandeep Kumar B

  • How to get the version of Java in browser??

    I need to check the verson of Java in browser?? Can anybody help me?
    I need to check that, and send it to serwer somehow :)
    Any code would be usefull. Thanks

    see if this helps :
    http://www.javatester.org/version.html

  • How to get the PDF Document version when using Digital Signature

    Hi,
    I have a form which contains two signature fields.
    When i sign the form the pdf document is saved as a version which can be seen by clicking the Signature Panel.
    I need to get the binary of the versions stored in the form.
    Please suggest me the how to get the version data from the form.
    Regards,
    S.V.atish Kumar

    Hi Mithun:
    I think I have run into a similar issue and have not been able to find a resolution.
    I have been trying to place three groupings of data and limit them to 15 rows; additional rows would print on a void check on a next page using the rtf template.
    Earnings .............. Pre-Tax Deductions .........Taxes
    <line 1 earnings> <line 1 pre-tax deductions> <line 1 tax dedcutions>
    <line 2 earnings> <line 2 pre-tax deductions> <line 2 tax dedcutions>
    <line 3 earnings> <line 3 pre-tax deductions>
    <line 4 earnings> <line 4 pre-tax deductions>
    <line 5 earnings>
    <line 6 earnings>
    The template works fine with these lists as nested tables until I add in the restriction and filler for the 15 rows for the first table. The data in the 2nd two lists does not appear once the limitation is added.
    Check Writer (XML)  - Issues with payroll check stub in rtf
    As an alternative, I have been thinking adding the remaining line totals (over 15 rows) and adding a 16th row. However I have been running into an error when trying to use the code for-each-group.
    *** XML-22056: exactly one of four group attributes must be present in xsl:for-each-group
    Can you send me your template to review? My email is: Karen.Lacey(AT)paetec(DOT)com
    Thanks!
    Edited by: RedLacey on Dec 17, 2009 11:48 AM

  • How to get the only the changed or newly added entries in AFTER SAVE.

    I have created table maintenance generated for a table,I want to get the newly added or changed entries while saving thats why im using AFTER SAVE event for the same,can anyone please tell me how to get the only the changed or newly added entries in AFTER SAVE.

    Hi,
    Welcome you post on the forum.
    I have moved your thread here because it is in English and should not in the language specific forum. What is your system version?
    Thanks,
    Gordon

Maybe you are looking for

  • N73 Mobile shut down and not starting

    hi pls help me I having N73 nokia i having problem for my mobile last week suudenly switched off i try to make on its showing start up failier contact retailer can any one help me whats the problem for my divice

  • Best Way to Export Movie to use in WebSite Intro??

    Hy everyone, Im doing a animation with 20 seconds in After Effects. I wana use that animation in the intro of my WebSite that is most of it Flash AS3. I wana ask u guys, what is the best format to export the video, so it dosent loose many Resolution,

  • Upgrade to Hyperion Enterprise 6.5.1.1.102 - Performance Issues

    We are testing an upgrade to Hyperion Enterprise 6.5.1.1. We have applied the Update 2 patch which I believe officially takes the version to 6.5.1.1.102. In testing reports and consolidation between the new version and the old 6.4.1 version of Enterp

  • TechTool Deluxe (applecare CD) unmounted my hard drive

    I'll just detail what happened, any and all suggestions would be helpful. 1. Ran Permission repair utility: everything checked out 2. Ran Disk repair utility: Catalog error found 3. Rebooted mac with techtool deluxe cd. 4. Enabled all tests (includin

  • Moving iPod touch contents to new device

    I lost my iPod touch back in March. Have tried finding my device, and it always says Offline. I have a new iPod touch being delivered today. How do I go about getting all the apps, music, etc. from the backup of my old iPod to my new one? Thanks