Get the current version and level of sp.listitem

I'm using a client script to get sp.listitem from a context.
Everything works and load my item
myCtxtWeb.Load(item);
myCtxtWeb.ExecuteQuery();item.Versions;//doesn't existitem.Level;//doesn't exist
Now i need to know the current version and the previous to compare the modified date between them.
Unfortunately the property doesn't exist and same with property level for having the info if it's approved
Are there a way to have them?

For information, i found the solution
SP.File newsItemFile = targetItem.File;
SP.FileVersionCollection fileVersions = newsItemFile.Versions;
myCtxtWeb.Load(fileVersions);
myCtxtWeb.ExecuteQuery();
if (fileVersions.Count > 0)
SP.FileVersion currentVer = fileVersions[fileVersions.Count - 1];//get current version
if (currentVer.VersionLabel == "1.0")
return "add";
Hope it helps some people

Similar Messages

  • I connect my iphone 4 to my itunes and when I press update to get the new iOS 7 software, it says "This version of iTunes (10.6.3) is the current version" and it tells me to press ok. Why is my phone not updating??

    My phone says it is connected to itunes and beside the update button it says "a newer version of iphone software is available (version 7.0)...." but when I press 'update' a box pops up that says ""This version of iTunes (10.6.3) is the current version" and then I press okay and nothing else happens. I'm getting frustrated. if anyone can explain to me why I can't update please tell me! Or else I'll have to call up Apple I guess.
    thanks!

    You have answered your own question:
    "requires 10.6.3 or higher"
    " i upgraded my itunes to 10.5 "
    You need itunes 10.6.3 or later.

  • How do i programmatically get the current version of a file?

    I asked this same question in the SP2013 forum and I haven't been able to determine the solution. So I posting this here, to maybe get more eyes on this issue. 
    ...I am basically trying to programmatically get the current version of a document in a library, then determine if its a major or minor version, in code. I have tried doing this, to get the current version but I keep getting an empty string returned.
    var versions = item.File.Versions;
    string currentVersion = string.Empty;
    foreach (SPListItemVersion version in item.Versions)
    DateTime lastMod = version.Created;
    foreach (SPFileVersion fileVersion in versions)
    if (fileVersion.IsCurrentVersion == true)
    currentVersion = fileVersion.ToString();
    Does anyone know what am doing wrong, and how to get this resolved? I really appreciate the help. Thanks

    Why not just get the SPListItem and look at it's Version property? That'll be the latest version.
    No need to go into the Versions collection etc. When you get a list item you get the current version as standard.
    w: http://www.the-north.com/sharepoint | t: @JMcAllisterCH | YouTube: http://www.youtube.com/user/JamieMcAllisterMVP

  • How do i get the current version of web logic server on obiee 11g

    Hey
    I am pretty new to 11g and Weblogic
    How do i get the current version of web logic server on obiee 11g(11.1.1.5), I know that it should be higher than 10.3.5.
    Thanks

    Hi,
    Obiee11.1.1.5.0/6.0 both version supporting weblogic 10.3.5.0/6.0 both are no issues.
    http://blog.whitehorses.nl/2012/02/26/a-few-quick-tips-for-upgrading-ofm-11g-to-patch-set-5/
    also refer
    http://docs.oracle.com/cd/E23943_01/bi.1111/e16452/bi_plan.htm#BABECJJH
    Thanks
    Deva

  • Get the Current Quarter  and Current Week from date

    Hi,
    I want to get the Current quarter and Current week from a given date, which function modules should i use?
    I tried using function module - 'HR_99S_GET_QUARTER' for getting the quarter but it is throwing an error while loading data. Moreover it doesnt exist in BI7.
    Similarly for current week.
    Please help. Sample code snippets would be appreciated.
    Thanks
    Jaya

    You can use FORM time_conversion wich is the one used by standard in Update Rules:
    You can select whether convert 0CALDAY to 0CALWEEK or whatever infobject formats you prefer...
      perform time_conversion
                using  '0CALDAY'
                       '0CALMONTH'
                        p_input_date
                        l_fscvtval
                changing RESULT
                         c_t_idocstate
                         c_subrc
                         c_abort.
      if c_subrc <> 0 or c_abort <> 0.
        exit.
      endif.
    form time_conversion
                   using i_timnm_from type rsiobjnm
                         i_timnm_to   type rsiobjnm
                         i_timvl
                         i_fiscvarnt  type t009b-periv
                   changing e_timvl
                            c_t_idocstate  type rsarr_t_idocstate
                            c_subrc   like sy-subrc
                            c_abort   like sy-subrc. "#EC *
    data: l_timvl  type rsd_chavl,
          l_result type rsd_chavl.
      IF i_timvl CO ' 0'.
        CLEAR e_timvl.
        EXIT.
      ENDIF.
      l_timvl = i_timvl.
      CALL FUNCTION 'RST_TOBJ_TO_DERIVED_TOBJ'
        EXPORTING
          i_timnm_from             = i_timnm_from
          i_timnm_to               = i_timnm_to
          i_timvl                  = l_timvl
          I_FISCVARNT              = i_fiscvarnt
          I_BUFFER                 = rs_c_true
        IMPORTING
          E_TIMVL                  = l_result
        EXCEPTIONS
          INCOMPATIBLE_TOBJS       = 1
          NO_INPUT_VALUE           = 2
          FISCVARNT_MISSING        = 3
          INPUT_NOT_NUMERIC        = 4
          WRONG_DATE               = 5
          WRONG_FISCPER            = 6
          X_MESSAGE                = 7
          OTHERS                   = 8
      e_timvl = l_result.
    ENDFORM.                  "TIME_CONVERSION

  • When I try to animate Nexrad radar on weatherunderground ..I get yesterdays radar and no animation. On Internet Explorer I get the current radar and animation.

    When I try to animate Nexrad radar on weatherunderground ..I get yesterdays radar and no animation. On Internet Explorer I get the current radar and animation.
    == URL of affected sites ==
    http://www.wunderground.com/radar/mixedcomposite.asp?region=b3&size=2x&type=loop

    You can try Firefox Safe Mode to see if one or more of your add-ons might be causing the problem. Also clearing the cookies for the site might help. The site loaded with current date and animation on my system.
    <u>'''Cookies'''</u>
    See:
    http://support.mozilla.com/en-US/kb/Deleting+cookies#Delete_cookies_for_a_single_site
    http://support.mozilla.com/en-US/kb/Cookies
    <u>'''Safe Mode'''</u>
    You may need to use '''[[Safe Mode]]''' (click on "Safe Mode" and read) to localize the problem. Firefox Safe Mode is a diagnostic mode that disables Extensions and some other features of Firefox. If you are using a theme, switch to the DEFAULT theme: Tools > Add-ons > Themes <u>'''before'''</u> starting Safe Mode. When entering Safe Mode, do not check any items on the entry window, just click "Continue in Safe Mode". Test to see if the problem you are experiencing is corrected.
    See:
    '''[[Troubleshooting extensions and themes]]'''
    '''[[Troubleshooting plugins]]'''
    '''[[Basic Troubleshooting]]'''
    If the problem does not occur in Safe-mode then disable all of your Extensions and Plug-ins and then try to find which is causing it by enabling <u>'''one at a time'''</u> until the problem reappears. <u>'''You MUST close and restart Firefox after EACH change'''</u> via File > Restart Firefox (on Mac: Firefox > Quit). You can use "Disable all add-ons" on the Safe mode start window.

  • Get the Current Date and Time of a Location

    I have created a windowsPhoneApplication in silverLight 8.1.In my application,I have to upload videos on some server.The Uploading get failed If the Date and Time settings of my device is not the current Date and Time.So How can I get the current date
    and time even if the device settings is wrong?

    Hi shifana,
    Do you know server's time zone? If yes, you can manually translate to the correct time zone.
    Otherwise try some online time acquire API.
    --James
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Any advice on how to switch to ICloud on my 3g IPhone?  I am supposed to install OS 5, but the dialogue box says that my 4.2.1 OS is the current version and does not give me the option of downloading OS5.  Apple says I have to be running 5 to switch.

    Any advice on how to switch to ICloud on my 3g IPhone?  I am supposed to install OS 5, but the dialogue box says that my 4.2.1 OS is the current version and does not give me the option of downloading OS5.  Apple says I have to be running OS5 to switch.

    "iCloud requires iOS 5 on iPhone 3GS or later, iPod touch (3rd and 4th generation), iPad, or iPad 2; a Mac computer with OS X Lion
    From here >  http://www.apple.com/icloud/

  • How to get the name, version and path of the oracle suite(s) installed

    Hi,
    I am trying to gather information regarding the Name, Version and Path of Oracle installation(s) on a computer.
    E.g.
    Name = Oracle Database 9i Enterprise Edition
    Version = 9.0.00
    Path = C:\Oracle
    I don't want to do it by querying the system tables. Can anyone please guide me if there is anyway to get these from either registry, WMI or API.
    Any form of help is highly appreciated.
    Thanks in advance.

    Simply invoke installer (OUI).
    Werner

  • How to get the current data and time of SCOM server via SCOM SDK (API) calls?

    Hi,
    I need to read the current date and time of SCOM server via SOM SDK.
    Is there a class in SDK that provides this info ?
    Thanks,
    satheesh

    To get time and date of Alerts of SCOM, You can use following command let "get-scomalert"
    Also, You can refer below links
    http://blog.tyang.org/2013/02/21/using-scom-2012-sdk-to-retrieve-resource-pools-information/
    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question, please click "Mark As Answer"
    Mai Ali | My blog: Technical

  • How to get the current date and compare dates

    hi
    does anyone know how you would get the current date?
    furthermore, how to compare the current date with a past date to see how many days or months have past since then?
    thanks

    have a look at the Date class. new Date() creates an object containing the exact date and time at creation time. (Date).getTime() might be useful for comparing two dates. GregorianCalendar might be useful, too.

  • How can I get the current user and the current page?

    Hi everyone
    Question..
    It is possible to get the current user (from the user's database on apex) and the current page? (I mean, if I'm in page 4 be able to query a variable / function or something which could give me the current displayed page)
    Thank you very much... I'd been researching without success :-S so I'll appreciate your help
    Regards,
    Fury

    Fury,
    If the user has authenticated, :APP_USER is the name that was used. The current page id is in :APP_PAGE_ID.
    Although I showed bind variable notation for those, & substitution format and v() notation are also available for referencing developer-defined items or built-in names. See the User's Guide for more details.
    Scott

  • Getting the current time and comparing it to a time in the future

    Hello,
    I am seeing in my research some debate on the best way to get the time. I am reading that just using the Date class and calling getTime() is not the most reliable way to do things. Overall, I am trying to get the current time down to the millisecond. I then want to add 5 seconds to that time and then store that value. FInally, when the current time is greater or equal to this stored value, I want to continue on in my program. Can anyone point me in the right direction on how to calculate the time variable? Any help would be much appreciated. I am new to the JAVA world.
    Thanks,
    Tim

    To store the current time, simply use new java.util.Date(). Yes, there might be slight inconsistencies and it might not be the most accurate time possible, but without significant additional effort (perhaps a native O/S call or the use of another time library), you will not do much better. Calendar won't help in this instance either. The easiest way to get five seconds in the future is to do the following:
    Date now = new Date();
    Date future = new Date(now.getTime() + 5000);To store and retrieve the value, it depends on what you are doing. You can place it in the database via JDBC (BTW, if you trust the database timestamp more than Java's you can use something like Oracle's SYSDATE instead of Java's date in your SQL query). You can place it in the filesystem. You can store it in the user's session.
    - Saish

  • Get the current week and subtract 12 weeks

    Hi Experts,
    Am getting the system current date and getting the current week using the FM->GET_WEEK_INFO_BASED_ON_DATE. Again I want to subtract 12 weeks including the current week. But still confused with the logic.
    Also I came to know that I can use FM->DATE_GET_WEEK and can subtract 12 weeks from it.
    So please advice how can I proceed further and how can I get the weeks that should be lesser than the 12weeks from the current week.
    Waiting for your valuable ideas.:)
    Thanks and Regards,
    Ramakrishnan M

    Try this one:
    DATA: week      TYPE numc1,
             days      TYPE t5a4a-dlydy,
             date      TYPE p0001-begda,
             months    TYPE t5a4a-dlymo,
             years     TYPE t5a4a-dlyyr.
    CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
         EXPORTING
           date      = s_ord_dt-low
           days      = days
           months    = months
           signum    = '+'
           years     = years
         IMPORTING
           calc_date = date.

  • How to get the current filename and & or path

    How can I get the current path or filename?
    I didn't really find any answers in the net. this.path or app.path were suggested but I couldn't get it to work.
    Thanks in advance for your answer!
    Livecycle Designer ES 8.2.1.3144.1.471865

    Hi,
    event.target.path.toString();  will give the full path including the filename.
    event.target.documentFileName.toString();  will give the filename only.
    Good luck,
    Niall

Maybe you are looking for

  • How to create Matrix report in 9iAS portal

    Could u pls explain with an example how to create an Matrix Report using Web Portal wizard bcos I need to create many complex reports with user parameters where I am not getting flexibility in WebDb to create such reports. Thank you

  • Silly Question Regarding : Media browser

    Hello, I am sure it something simple, but I am stuck and I have done 3 hrs of searching, restarts and Preference kills. • Share previews with iLife and iWork is checked in Aperture • Aperture icon doesn't show up in the media browser Any ideas? Thank

  • Unicode conversion plan and estimate

    Hi, Can anyone who have gone through a UNICODE conversion provide a high level plan and timeline that was spent converting the system to unicode. We need an estimate of the conversion effort (not incl. an upgrade). The system is ECC 5.0 Thanks, Prash

  • Illustrator files won't open on shared drive.

    Just upgraded to Mac OS to Yosemite (10.10) and can no longer open files on a shared drive within Illustrator or other Creative Cloud apps.  However, if those files are transferred to desktop I can open them.  These exact same files were opening befo

  • Exchange Provisioning

    Hi everyone, While I execute exchange provisioning process, an arror occured : *2012-10-08T14:52:38.227+03:00] [oim_server1] [ERROR] [] [ORACLE.IAM.CONNECTORS.ICFCOMMON.PROV.ICPROVISIONINGMANAGER] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogi