How to Get List Item in Custom Context Menu?

Hi,
I got this code from the net.
<CustomAction Id="SPTest.CustomMenuItem.ButtonClicked"
RegistrationType="ContentType"
RegistrationId="0x0101"
Location="EditControlBlock"
ImageUrl="/_layouts/IMAGES/DOCLINK.GIF"
Sequence="600"
Title="Click Me!"
Description="Shows an alert message for this content type."
>
<UrlAction Url="javascript:alert('Hello World!');" />
</CustomAction>
It creates a custom context menu. How can i get the selected item using that code..
Sorry for the tons of question. SharePoint newbie here (5 weeks in SP), Hehhehe!

If you can redirect your request on context.....you can try this line of code
<UrlActionUrl=”~site/_layouts/ItemAudit.aspx?ID={ItemId}&amp;List={ListId}”/>
The Idea is to send in query string parameter and get the ItemID in the Pageload Event of the page you want to redirect to.
Other tokens that are available
Token
Replaced By
~site/
SPContext.Current.Web.ServerRelativeUrl
~sitecollection/
SPContext.Current.Site.ServerRelativeUrl
{ItemId}
item.ID.ToString()
{ItemUrl}
item.Url
{SiteUrl}
web.Url
{ListId}
list.ID.ToString(“B”)
{RecurrenceId}
item.RecurrenceID
Srikant N , MCPD SharePoint Developer 2010

Similar Messages

  • 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 modify the list item drop down context menu in SharePoint 2010

    Hi All,
    I have a requirement to add my name in the list item drop down context menu, already "Assigned ticket" option is available in the context menu and some names are available in the assigned ticket option. but i can't able to add my name in this options.
    Attached screenshot for reference. Thanks in advance for your assistance!
    Thanks
    Arun Prakash

    Do you know how the currently listed values got there in the first place? Some sort of custom code or action? Some background information would help. There is obviously a source feeding it from somewhere, but it's impossible for us to tell you exactly
    what just by looking at your scribbled-over screenshot
    Check WSPs that are deployed to the farm. Check for any non-OOTB site features that are turned on...

  • How to get list item from LongListSelector

    I have a list item in LongListSelector like this:
    Now when i tap on the app button so I will have the list of item in the LongList where check box value is true
    Any help or advice ?

    Add a property to the class the long list selector is bound to for the checkbox.  Loop through the items in the data source and use the new property to tell what is checked

  • How to get workflow Item in custom FM ( method )

    Dear Expert,
    I am developing the workflow for PR release. We don't have the HR module so we are using Z-table for the release agent. I am using the BUS2105 for the workflow. I have created a new method to get the PR release agent and send mail to those agent asking for release and some other user to be notified.
    I deligated ZBUS2105 and implemented the method to that object. The workflow is working as per the requirement but I am not able to get the PR number in FM of the Method.
    FM name  :  ZMAIL
    Import       :  PRNUMBER         like EBAN-BANFN
                       RELEASECODE   like T16FC-FRGCO
    Tables      : USRS_EMAILIDS
                     USRS_TOBE_NOTIFIED
                     USRS_TOBE_APPROVED
    in the FM i am sending mail to the respective agent , I have to mention the PR number in the Body of the email but unfortunately the PR number is not coming in the Import paramete PRNUMBER  where as i am getting the release code in RELEASECODE .
    I would like to request you guide me how I can get the PRNUMBER  in my FM which I have assigned to the custom method of ZBUS2105.
    Best Regards
    Sony

    Hi,
    Check the binding and Data Type of the  PR no. that you are passing.
    For the PR workflow, take a below note.
    WS20000077 this std. Workflow for the PR Release this has multiple levels of approvals, Depends on the no. of approvals it will flow.
    The approver can picked using the User Exit M06B0001 (EXIT_SAPLEBNF_001), here you have to write a logic to pick the Approver.
    The approval workitem comes to SAP Inbox, once the approver click the workitem it will open the Transaction, there the user can approve.
    To see the status of the Workflow, Go to ME53N, in the top left a button, Service Object, click on that, a drop down appear in Workflow > Workflow Overview, you can see the status here.
    Regards,
    Surjith

  • How to get list information on custom ribbon button click in list forms(Editform/Dispform)?

    Hello All,
    I have custom ribbon button on editform/dispform in my list. I want to display current list name on button click of this custom ribbon button. How to achieve it??
    Thanks in advance..!!

    Hey,
    Did you ever tried this variables?
    Anyways variable _spPageContextInfo.pageListId' works for me. It will give list GUID on listforms.
    <CommandUIHandler Command="EditFormButtonCommand" CommandAction="javascript:window.open(L_Menu_BaseUrl + '/_layouts/incitemkt/downloadallattachments.aspx?ID=' + {ItemId} + '&amp;source=' + _spPageContextInfo.pageListId);" />
    Thanks.

  • SharePoint 2013 Rest Api - How to get List Items

     
    Can anyone let me know why the below method fails? I am not getting where i am making mistake. Please help
    function getListItems(term) {
                var caml = "<View><Query><Where><BeginsWith><FieldRef Name=Title/><Value Type='Text'>" + term + "</Value></BeginsWith></Where></Query></View>";
                var requestData = { "query": { "__metadata": { "type": "SP.CamlQuery" }, "ViewXml": caml } };
                $.ajax({
                    url: _spPageContextInfo.webAbsoluteUrl + "/_api/Web/Lists/getbytitle('SampleList')/Getitems",
                    method: "POST",
                    data:requestData,
                    headers: {
                        "accept": "application/json; odata=verbose",
                        "content-type": "application/json; odata=verbose"
                    success: function (data) {
                        $("#countItem").html("Pass");
                    error: function (data) {
                        $("#countItem").html("Fail");
    Below is the responseText (log)
    "{\"error\":{\"code\":\"-1, Microsoft.SharePoint.Client.ClientServiceException\",\"message\":{\"lang\":\"en-US\",\"value\":\"The HTTP method \'GET\' cannot be used to access
    the resource \'GetItems\'. The operation type of the resource is specified as \'Default\'. Please use correct HTTP method to invoke the resource.\"}}}"
    Navaneeth

    Finally executed successfully using below code. The learning is we need to use  type:"POST" instead of method:"POST"
     function getListItems(term) {
                var urltest = _spPageContextInfo.webAbsoluteUrl + "/_api/Web/lists/getByTitle('SampleList')/getitems(<Query><Where><BeginsWith><FieldRef">query=@v1)?@v1={\"ViewXml\":\"<View><Query><Where><BeginsWith><FieldRef
    Name='Title'/><Value Type='Text'>" + term + "</Value></BeginsWith></Where></Query><RowLimit>1</RowLimit></View>\"}";
                $.ajax({
                    url: urltest,
                    type: "POST",
                    headers: {
                        "X-RequestDigest": $("#__REQUESTDIGEST").val(),
                        "Accept": "application/json; odata=verbose",
                        "Content-Type": "application/json; odata=verbose"
                    contentType: 'application/json',
                    success: function (data) {
                        if (data.d.results.length != 1) {
                            $("#countItem").html("Pass");
                            $("#" + term).parent().parent().prop('disabled', true);
                            $("#" + term).removeAttr("onclick");
                            $("#" + term).css('cursor', 'default');
                            $("#" + term).parent().unbind("mouseenter mouseleave");
                    error: function (data) {
                        $("#countItem").html(urltest);
    Navaneeth

  • Get list items using spservices for sharepoint 2013

    Hi,
    I have a requirement like below.
    I have 2 sharepoint custom list with some columns.
    List1:listA
    List2:listB
    Now when i open the listB new item form i want some of the field values from listA should auto populate in Textboxes of listB new form.
    Is there any ways to implement this?
    Regards,
    Poovi

    Hi Poovi,
    You can achieve this using jQuery to get the SharePoint list items. Refer the below articles. It has explained how to get list items using jQuery and auto populate a text-box from a list item as a source.
    You can put this code in list forms through SharePoint Designer. The articles explain about auto populating text box of web part but similarly you can implement it for list form, because nevertheless the text boxes are same.
    http://www.c-sharpcorner.com/UploadFile/sagarp/sharepoint-2010-jquery-autocomplete-textbox-containing-list/
    http://tomvangaever.be/blogv2/2011/07/sharepoint-2010-autocomplete-with-list-items/
    Please remember to click 'Mark as Answer' if the reply answers your query or 'Upvote' if it helps you.

  • How to get page item list in  a page?

    how to get page item list in  a page?

    Have a look at ISpread::GetItemsOnPage().
    That should get you started.

  • 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

  • How to get work item details programatically ?

    Hi All,
    I have a list of work items (process instances) and I want to retrieve each item details such as: attachments, notes, id, ...
    All the items are filtered and represented as Fuego.Papi.Instance:
    Fuego.Papi.Instance[] inst = busProcess.getInstancesByFilter(filter : instFilter);
    But the work item details are inherited from Fuego.Lib.ProcessInstance. So, how to get the item details from inst[] ?
    Would appreciate any help, may be Dan will have an advise ?
    Regards,
    Kim

    If you have instances returned by your filter, you could extract variable information for each instance by doing something like this:
    for each inst in getInstancesByFilter(ps, filter : instF) do
        // here's how to get the value inside a primitive instance variable
        orderAmtObj as Object = getVar(inst, var : "orderAmount")
        // here's how to get the value of attributes inside a complex BPM Object instance variable
        //    - in this case this is an "order" object with two attributes (customerName and amount)
        orderObj as Object = (getVar(inst, var : "order"))
        xmlObject = Fuego.Xml.XMLObject(createXmlTextFor(DynamicXml, object : orderObj, topLevelTag : "xsi"))
        logMessage "The value of the order object's customer name is: " +
               selectString(xmlObject, xpath : "customerName")
        logMessage "The value of the order object's order amount is: " +
               selectNumber(xmlObject, xpath : "amount")
        // here's a rather uninspired way to retrieve who the participant is that was assigned the instance
        logMessage "The participant assigned to this instance is: " + inst.participantId
    endInside the above "for" loop, you could retrieve these predefined variables (this example assumes you use "inst" in your "for" loop):
        objRet as Any
        objRet = inst.getVar(var : "PREDEFINE_ACTIVITY")
        logMessage "Activity name = " + objRet using severity = DEBUGSubstitute "PREDEFINE_ACTIVITY" in the above logic to get this information:
    PREDEFINE_PRIORITY (priority)
    PREDEFINE_ACTIVITY_DEADLINE (activity.deadline)
    PREDEFINE_CREATION_TIME (creation.time)
    PREDEFINE_PROCESS_DEADLINE (deadline)
    PREDEFINE_DESCRIPTION (description)
    PREDEFINE_PROCESS (process)
    PREDEFINE_RECEIVED_TIME (receptionTime)
    PREDEFINE_PARTICIPANT (participant)
    PREDEFINE_COPY (id.copy)
    PREDEFINE_STATUS (status)
    Similarly, you might want to try to get instance information using the Fuego.Papi.VarDefinition object a try. Never used it, but the logic might be as simple as:
        logMessage "who created? = " + inst.getVar(Fuego.Papi.VarDefinition.CREATOR_ID) using severity = DEBUG
        logMessage "does it have attachments? = " + inst.getVar(Fuego.Papi.VarDefinition.HAS_ATTACHMENTS) using severity = DEBUG   
        logMessage "does it have notes? = " + inst.getVar(Fuego.Papi.VarDefinition.hasnotes) using severity = DEBUGDan

  • How to copy List item from one list to another using SPD workflow using HTTP call web service

    Hi,
    How to copy List item from one list to another using SPD workflow using HTTP call web service.
    Both the Lists are in different Web applications.
    Regards, Shreyas R S

    Hi Shreyas,
    From your post, it seems that you are using SharePoint 2013 workflow platform in SPD.
    If that is the case, we can use Call HTTP web service action to get the item data, but we cannot use Call HTTP web service to create a new item in the list in another web application with these data.
    As my test, we would get Unauthorized error when using Call HTTP web service action to create a new item in a list in another web application.
    So I recommend to achieve this goal programmatically.
    More references:
    https://msdn.microsoft.com/en-us/library/office/jj164022.aspx
    https://msdn.microsoft.com/en-us/library/office/dn292552.aspx?f=255&MSPPError=-2147217396
    Thanks,
    Victoria
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • 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.

Maybe you are looking for