How to get list name through javascript?

Hi,
I wrote javascript for getting list items but here I'm hard coded list name as "Projects"(my list name). How can I get list name automatically with out hard coding,
Appreciate if anyone help.
Thank you.
function DoLogicalDelete()
var clientContext = null;
var oList = null;
var oListItem = null;
// var lstItmIsDeleted = null;
var itmID = getQuerystring('ID');
clientContext = SP.ClientContext.get_current();
oList = clientContext.get_web().get_lists().getByTitle('Projects');
// var oListItemID = SP.ListOperation.Selection.getSelectedItems(clientContext);
oListItem = oList.getItemById(itmID); // getting ID
clientContext.load(oListItem,"Title", "IsDeleted"); // load items to oListItem
oListItem.set_item('IsDeleted', true);
oListItem.update();
clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded),Function.createDelegate(this, this.onQueryFailed));

Not sure on which context you are executing the code. If you executing this from the list form and trying to get the current list, then you may need to get the list name from the breadcrumb/list title field. Refer to the following posts for more information
http://sharepoint.stackexchange.com/questions/39008/how-to-get-list-name-from-js-object-model-list-name-from-url-problem
http://itrob.be/sharepoint-get-all-lists-names-in-javascript-spservice-and-jquery/
--Cheers

Similar Messages

  • How to get infoprovider name through Table Interface

    Hi All,
    I need to get technical name of the infoprovider in the table interface. Is there a way to do that?
    Thanks a lot!
    Pavel

    The Technical Name of this Custom ODS is /BIC/AZ0PS_C0700 - Which is the ACTIVE Table. The Table name is suffixed with 00.
    If it is a Cube then the key figures of this Cube are stored either in E table or F table depends. Which will have a technical name as /BIC/EZ0PS_C07 & /BIC/FZ0PS_C07.
    Here you will find only Key Figures & not the Characteristics / Dimensions. For viewing all the contents you will have to see the InfoCube Contents.
    Hope this helps,
    Pradip.

  • How to get list of file names from a directory?

    How to get list of file names from a directory?
    Please help

    In addition, this:
    String filename = files;Should be this:
    String filename = files;
    That's just because he didn't use the "code" tags, so [ i ] made everything following it become italicized.                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to get List Item attachments name without write any custom code or any database query?

    Hi,
    How to get List Items attachments name without write any custom code or any database query?

    You can get it from Rest,
    There are 2 options,
    1) create a 'Result Source' which has a search query for that List which has attachments 
     - Use rest query to get the 'Filename' , it will have the attachment file name 
    For example, if the result source id is : 73e6b573-abf8-4407-9e5f-8a85a4a95159 , then the query will be 
    http://[site URL]/_api/search/query?querytext='*'&selectproperties='Title,Path,FileExtension,SecondaryFileExtension,Filename'&sourceid='73e6b573-abf8-4407-9e5f-8a85a4a95159'&startrow=0&rowLimit=100
    You can refine the query, be giving proper 'querytext'
    2) Use the List rest api
    For example if your list guid is :38d524a1-e95c-439f-befd-9ede6ecd242e
    You can get he attachments for 1st item using this 
    http://[Site URL]/_api/lists(guid'38d524a1-e95c-439f-befd-9ede6ecd242e')/items(1)/AttachmentFiles
    get2pallav
    Please click "Propose As Answer" if this post solves your problem or "Vote As Helpful" if this post has been useful to you.

  • How to get list of active users with the details like samaccountname, name, department, job tittle, email in active directoy?

    how to get list of active users with the details like samaccountname, name, department, job tittle, email in active directoy?

    You can use third party software True Last Logon 2.9.You can export the file in excel for report creation.You can use the trial version this will achieve what you are looking for.
    True Last Logon displays the following Active Directory information:
    --Users real name and logon name
    --Detailed account status
    --Last Logon Date & Time
    --Last Logon Timestamp (Replicated value)
    --Account Expiry Date & Time
    --Enabled or Disabled Account
    --Locked Accounts
    --Password Expires
    --Password Last Set Date & Time
    --Logon Count
    --Bad Password Count
    --Expiry Date
    --You can also query for any other attribute (Example: Description, telephone Number, custom attibutes etc)
    Refer the below link for trial version:
    http://www.dovestones.com/products/True_Last_Logon.asp
    Best Regards,
    Sandesh Dubey.
    MCSE|MCSA:Messaging|MCTS|MCITP:Enterprise Adminitrator |
    My Blog
    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

  • How to get List of SharePoint Groups to which Current Users belongs using Javascript ?

    How to get List of SharePoint Groups to which Current Users belongs using JavaScript? Not JSOM

    Here is the code that worked for me:
    var userid= _spPageContextInfo.userId;
      var requestUri = _spPageContextInfo.webAbsoluteUrl + '/_api/web/CurrentUser/Groups?$select=Id,Title';
    alert(requestUri);
      var requestHeaders = { "accept" : "application/json;odata=verbose" };
      $.ajax({
        url : requestUri,
        contentType : "application/json;odata=verbose",
        headers : requestHeaders,
        success : onSuccess,
        error : onError
      function onSuccess(data, request){
    var s='';
     for (var i = 0; i < data.d.results.length; i++)
    s +=data.d.results[i].Title+'\n';
        alert(s);
      function onError(error) {
        alert("error");

  • How to get list of tables used in packages

    Dear All
    Can you pls tell me how to get list of tables used in packages
    Regards

    select referenced_name
      from user_dependencies
    where name = 'your_package'
       and referenced_type = 'TABLE'Regards,
    Rob.

  • How to get Actions name

    I want to get Actions name by javascript.
    Can get Actions name at javascript?

    Here is an example of creating a list of all the action sets/names to the desktop.
    #target photoshop
    var actionList = getActionSets();
    var outFile = File("~/desktop/Action List.txt");
    outFile.open("w");
    for(var a in actionList){
       outFile.writeln("Action Set " + actionList[a]);
       var aList = getActions(actionList[a]);
       for(var z in aList) {
          outFile.writeln(aList[z]);
    outFile.close();
    outFile.execute();
    function getActionSets() {
    cTID = function(s) { return app.charIDToTypeID(s); };
    sTID = function(s) { return app.stringIDToTypeID(s); };
      var i = 1;
      var sets = []; 
      while (true) {
        var ref = new ActionReference();
        ref.putIndex(cTID("ASet"), i);
        var desc;
        var lvl = $.level;
        $.level = 0;
        try {
          desc = executeActionGet(ref);
        } catch (e) {
          break;    // all done
        } finally {
          $.level = lvl;
        if (desc.hasKey(cTID("Nm  "))) {
          var set = {};
          set.index = i;
          set.name = desc.getString(cTID("Nm  "));
          set.toString = function() { return this.name; };
          set.count = desc.getInteger(cTID("NmbC"));
          set.actions = [];
          for (var j = 1; j <= set.count; j++) {
            var ref = new ActionReference();
            ref.putIndex(cTID('Actn'), j);
            ref.putIndex(cTID('ASet'), set.index);
            var adesc = executeActionGet(ref);
            var actName = adesc.getString(cTID('Nm  '));
            set.actions.push(actName);
          sets.push(set);
        i++;
      return sets;
    function getActions(aset) {
    cTID = function(s) { return app.charIDToTypeID(s); };
    sTID = function(s) { return app.stringIDToTypeID(s); };
      var i = 1;
      var names = [];
      if (!aset) {
        throw "Action set must be specified";
      while (true) {
        var ref = new ActionReference();
        ref.putIndex(cTID("ASet"), i);
        var desc;
        try {
          desc = executeActionGet(ref);
        } catch (e) {
          break;    // all done
        if (desc.hasKey(cTID("Nm  "))) {
          var name = desc.getString(cTID("Nm  "));
          if (name == aset) {
            var count = desc.getInteger(cTID("NmbC"));
            var names = [];
            for (var j = 1; j <= count; j++) {
              var ref = new ActionReference();
              ref.putIndex(cTID('Actn'), j);
              ref.putIndex(cTID('ASet'), i);
              var adesc = executeActionGet(ref);
              var actName = adesc.getString(cTID('Nm  '));
              names.push(actName);
            break;
        i++;
      return names;

  • How to get listed as a XMP partner?

    Hi there
    We have just released a major metadata/keywords update, to our Digital Asset Management solution, based on Adobes XMP format.
    Does anybody know how to get listed on the XMP partner page: http://www.adobe.com/products/xmp/partners.html
    Thanks,
    Jesper
    Filecamp.com

    Hi Frank
    Just wanted to make sure you got our company information:
    Your full company name
    Filecamp AG
    A company representative (name, title)
    Jesper Faurby, CEO, Filecamp AG
    About the partner
    Filecamp is a lightweight Digital Asset Management, Image Library, and Online Proofing solution. Filecamp provides a secure customer branded platform to organize, review, approve, and share digital assets. Subscribers are from all over the world - ranging from freelancers to large corporations, usually from within the creative/media industry.
    The value of XMP technology
    "Adobe's XMP technology enables Filecamp to read and write metadata for common file types. Our customers appreciate the embedded metadata which allows keywords and more, to "travel" along with the files across various products, vendors and platforms."
    Logo
    A 170x55 px version of the logo can be downloaded from here: https://files.filecamp.com/public/file/21xp-1cum8c4d
    Many thanks for your help. Please let me know if you have any questions.
    Ok?
    Best regards
    Jesper Faurby
    www.filecamp.com
    Media Asset Management, Image Library, Professional File Hosting & Online Proofing ... in one integrated, secure and cost-effective solution.

  • Better way how to get list of all classpath URLs in runtime

    Hello everyone,
    How to get list of all classpath items (URLs) in runtime from Java code?
    I am aware of solution based on System.getProperty("java.class.path"). Is there any alternative?
    This solution has several drawbacks. You have to parse String output. And I not sure if it contains ALL resources (JARs, class directories) loaded by ClassLoader or just reflects -cp arguments.
    Does system property "java.class.path" contain ALL loaded JARs?
    Does it contain items (JARs, class directories) loaded by bootstrap classpath?
    What about JARs loaded in runtime?
    Is the separator ":" always same on all operation systems?
    I was looking for some Java API based solution, method like List<URL> getAllClasspathItems()
    But there is nothing like this in ClassLoader, Class, Runtime or System classes.
    For curious, here is code I use.
    String classpath = System.getProperty("java.class.path");
    StringTokenizer st = new StringTokenizer(classpath, ":");
    while (st.hasMoreElements()) {
         System.out.println(st.nextElement());
    }

    For curious, here are output prints for all 3 methods:
    1) parsing system property
    2) tschodt
    3) overcast SystemClassLoader to URLClassLoader
    /home/espinosa/workspace/jboss_embedded_test1/target/test-classes
    /home/espinosa/workspace/jboss_embedded_test1/target/classes
    /opt/javalibs/javax/ejb/ejb-api/3.0/ejb-api-3.0.jar
    /opt/javalibs/javax/jms/jms/1.1/jms-1.1.jar
    /opt/javalibs/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar
    package com.sun.org.apache.xerces.internal.impl.validation, Java Platform API Specification, version 1.6
    package com.thoughtworks.qdox.directorywalker
    package com.sun.org.apache.xerces.internal.parsers, Java Platform API Specification, version 1.6
    package java.util.jar, Java Platform API Specification, version 1.6
    package org.testng.internal.thread
    package com.sun.org.apache.xerces.internal.util, Java Platform API Specification, version 1.6
    package java.net, Java Platform API Specification, version 1.6
    package sun.reflect.misc, Java Platform API Specification, version 1.6
    package esp.ejb.samples1.test
    package sun.security.provider, Java Platform API Specification, version 1.
    file:/home/espinosa/workspace/jboss_embedded_test1/target/test-classes/
    file:/home/espinosa/workspace/jboss_embedded_test1/target/classes/
    file:/opt/javalibs/javax/ejb/ejb-api/3.0/ejb-api-3.0.jar
    file:/opt/javalibs/javax/jms/jms/1.1/jms-1.1.jar
    file:/opt/javalibs/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar
    ...Interestingly, method 1 and 3 gives the same list, same order, same count, just format of item is a little bit different. The order is same as in Eclipse .classpath file.
    Method 2 (tschodt) give significantly more items! rougly 3x! Different order (somewhat random it seems to me). Some items contain extra information, like version and string "Java Platform API Specification".
    It prints not absolute paths but logical Java names.

  • How to get list of fonts on current system(forms6i)

    Does anyone know how to get list of all available fonts on system. I want to add available fonts to list item (forms 6i) dinamicaly.

    depending on what exactly you want to know:
    System.getProperty("java.version")
    System.getProperty("java.vendor")
    System.getProperty("java.vm.version")
    System.getProperty("java.vm.vendor")
    System.getProperty("java.vm.name")
    Nick.

  • How to get list of applied patches which applied using admrgpch

    How to get list of applied patches which applied using admrgpch

    You can't really get the individual patch IDs from a merged patch, unless you have the log file from the admrgpch run available.
    You can, however, get the list of bugs fixed by a merged patch, and those bug numbers sometimes, but not always, correspond to a patch ID. Keep in mind, though, that individual patches often contain entries for multiple bug numbers.
    Here's a query that I use to look at the contents of merged patches. It works best if the merged patches have been given unique names, instead of the default name 'merged' from admrgpch. If you run it and see that everything belongs to patch name 'merged,' you might want to change the selected column to ap.applied_patch_id instead of ap.patch_name.
    select ap.patch_name
    , ad.orig_patch_name
    , ad.driver_file_name
    , ad.merged_driver_flag
    , ad.merge_date
    , bug.bug_number
    , cp.patch_abstract
    from ad_applied_patches ap
    join ad_patch_drivers ad using (applied_patch_id)
    join ad_comprising_patches cp using (patch_driver_id)
    join ad_bugs bug using (bug_id)
    order by applied_patch_id;
    Regards,
    John P.
    http://only4left.jpiwowar.com

  • How to get list of software installed in a system

    How to get list of softwares installed in a system?. should i use registry to get information or control panel?
    is there any package available for this? how should i start with/
    thanks

    How to get list of softwares installed in a system?.Using native code, if at all.
    should i use registry to get information or control panel?Linux has neither.
    is there any package available for this? how should i start with/ Learn the Windows API or Google for some native tool.

  • How to get column names for a specific view in the scheme?

    how to get column names for a specific view in the scheme?
    TIA
    Don't have DD on the wall anymore....

    or this?
    SQL> select text from ALL_VIEWS
      2  where VIEW_NAME
      3  ='EMP_VIEW';
    TEXT
    SELECT empno,ename FROM EMP
    WHERE empno=10

  • How to get the name of the current tab.

    Hi Experts,
    I have two tabs in my tab strip and a button common to both the tabs.Can you please let me know how to get the name of the current tab in the event method of the push button.
    Thanks in advance.
    Regards,
    Arun

    1.Declare an Action for OnSelect event of Tabstrip. This event is triggered whenever any change in tab occurs.
    2. Declare an Import Parameter in this method
       Tab type String.
    3. This parameter has value of the selected TAB.
    4. You can set this value in some Attribute in Attribute Tab in this event only (OnSelect):
         wd_this->Att  = Tab.
    Att is the attribute created by you in Attributes Tab of View. ( of type String)
    5. Now the selected Tab ID is stored in this Attribute Att.
    6. In the Onaction of Button , retrieve the selected tab value from this attribute using :
               Data : lv type string.
                lv =  wd_this->Att
    Now lv has your selected TAB ID.
    I hope it would help you.
    Edited by: Saurav Mago on Oct 13, 2009 2:22 PM

Maybe you are looking for

  • How to preset fields in TA BP with default values

    Hi! I want to fill few fields in transaction BP with default values. This should be if there`s a new business partner to insert. If i can do this depending on the selected role it was the best First i thought on SPA/GPA-parameters ... but then i can`

  • Brand new ipod Not working!!! =[ Help please...

    Ok I downloaded the latest version of Itunes, I reset the Ipod, but for some reason my computer when I conect the usb cable the "found new hardware" windows pops up, I do not have a software to install for Ipod and the only thing I can find on the we

  • Deploy .war file in Ebs 11i-11.5.10.2

    Hi, My boss is asking me to deploy the .war file in one of the EBS 11i - 11.5.10.2 instance. I am wondering to know how can we deploy .war in EBS 11i Instance? If we can deploy the .war in EBS 11i Instance please post the high level steps and if not

  • Adobe Reader 9.1.2 does not maximize correctly under Linux

    This bug was originally reported at http://forums.adobe.com/message/1784395  Unfortunately, the bug seems to remain in the 9.1.2 release. Any word on when this bug will be fixed? John Perkins [email protected]

  • Barcoding

    Dear abap Gurus 1.  How to create Bar coding ?Can u send me step by step process its very urgent for me please? 2.Bdc upload the data for ct04 tcode i want bdc upload program? Can u send me program ?