SPQuery disables ribbon buttons

Hello,
I have an external list where I have added functionality so I can filter it.
string parameters = customersView.ParameterBindings;
customersView.ParameterBindings = parameters + "<ParameterBinding Name=\"Kontaktperson\" Location=\"QueryString(fldKontaktperson)\" /><ParameterBinding Name=\"Företag\" Location=\"QueryString(fldFöretag)\" />";
customersView.Query = "<Where><Or><Contains><FieldRef Name=\"Kontaktperson\" /><Value Type=\"Text\">{Kontaktperson}</Value></Contains><Contains><FieldRef Name=\"F_x00f6_retag\" /><Value Type=\"Text\">{Företag}</Value></Contains></Or></Where>";
This is working so I can filter the list, but when I select an item in the list the buttons (View, Edit and Delete) in the ribbon are disabled.
I can still select to view, edit or delete the item from the dropdown on the list item. So it is only in the ribbon the functions are disabled.
If i delete my Query, the buttons are enabled. But of course the filter functionallity is lost.
So something seems to be wrong with my Query.
But what is wrong?
Any help is appreciated.
Thanks.

Hi,
This would be a known issue when adding a parameter filter to a view of list, the item commands in ribbon will be disabled.
Please apply the SharePoint 2010 October/2010 CU and then do the test again:
http://support.microsoft.com/kb/2394323/en-us
Feel free to reply with the test result if the issue still exists.
Thanks
Patrick Liang
Forum 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]
Patrick Liang
TechNet Community Support

Similar Messages

  • List View WebPart custom XSL link disabled Ribbon Buttons

    Hi,
    I have added and external XSLT file for my List View web part. I followed these options in browser -> Edit page -> Edit web part -> Under Miscellaneous updated XSL Link.
    I am using this xslt file to add background colors to one of my column. The xslt is getting applied correctly. But I noticed that "View Item" and "Edit Item" option in ribbon is disabled. I removed the xslt link and ribbon worked fine.
    I have added the xslt file to site collection's "Style Library -> XSL Style Sheets" folder.
    When I added same xslt by editing the page in SPD 2010, everything worked fine. The problem appears only when I apply it externally. I found in few posts where they suggest to upload the xsl file in LAYOUTS folder. But I donot have access/permission to change
    the LayOuts folder. I donot want to edit in SPD because, it will be difficult for non technical administrators to apply xslt to other views/pages. Please suggest.
    - Thanks
    Lucky
    India

    I am facing the same issue. Is this issue resolved?

  • Disabled ribbon buttons on pendingreq.aspx

    Hello
    We use permissions request functionality.
    When we open pendingreq.aspx page in English interface, everything works just fine. But if we apply norwegian language, buttons "Approve" and "Decline" on the ribbon come to unavailable.
    May be someone knows how to solve this?

    Hi Alexander,
    For confirming this bug, I suggest you open a ticket for this case:
    http://support.microsoft.com  
    Best Regards,
    Wendy
    Forum 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]
    Wendy Li
    TechNet Community Support

  • Access 2013 Email Report ribbon button always disabled

    Access 2013 Email Report ribbon button is always disabled. This happens on one PC, All other installs are ok.
    Reinstalled Office and Access and problem continues. System is Win 8.1
    Default email client is Outlook 2013.
    Any suggestions?

    Hi,
    Printer is installed?
    Maurice
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer. Thank You

  • How to Hide/Disable custom ribbon button on infopath form!

    Is it possible to hide/disable custom ribbon button on specific infopath form library or list????
    I just want to hide/disable custom ribbon button for specific form library and show/enable these buttons on the other form library!
    Any suggessions??
    Thanks in advance!

    Hi Tahir,
    Using javascript you can show/hide ribbon on particualr page.
    Open your SharePoint master page
    Locate this line: <div
    id="s4-ribbonrow"
    class="s4-pr s4-ribbonrowhidetitle">
    Change it to: <div
    id="s4-ribbonrow"
    class="s4-pr s4-ribbonrowhidetitle"
    style="display:none">
    Now find the end of the “s4-ribbonrow” tag and add following
    block right after it: <Sharepoint:SPSecurityTrimmedControl
    ID="SPSecurityTrimmedControl2"
    runat="server"
    PermissionsString="AddAndCustomizePages">
        <script
    type="text/javascript">
            document.getElementById("s4-ribbonrow").style.display =
    "block";     </script> </Sharepoint:SPSecurityTrimmedControl>
    Save the new master page and publish it.
    Or try this feature.
    http://spribbonvisibility.codeplex.com/
    Best regards,
    Avinash.

  • Ribbon Button activating when a field in the Document / List item metadata = 'Yes'

    Im hoping this is an easy answer as Im sure it must be, but my mind has gone blank!
    Basically I have created a button to run some javascript code to fire a custom (manual) workflow on an item that is selected in a Document Library (or List)
    I have set the ribbon button to only be active IF one item is selected in the Library but what I want now is to only activate the ribbon button if one item is selected AND IF a specific field in the item = 'Yes' (The field in this case being called 'DraftDoc'
    [Choice field]).
    Ive tried a few methods but none seem to work and VS2012 errors on debugging.
    My code to enable the button so far is:
    // Method to enable/disable the button on the ribbon.
    function EnableSubmitDraftDocument() {
    // request number of selected items.
    var items = SP.ListOperation.Selection.getSelectedItems();
    var count = CountDictionary(items);
    // only return true is a single item is selected.
    return (count == 1);
    Can anyone help me with the extra code I need?
    Cheers

    Hi,     
    According to your description, you have been able to set the ribbon button to be actived if one item is selected. Now, you want to activate the ribbon button if there is one
    item selected and the value of "DraftDoc" column is "Yes".
    We can achieve it by getting the value of this "DraftDoc" column of the selected item to check whether it is "Yes".
    Here is a code demo about checking whether the value of "DraftDoc" column of the selected item for your reference:
    function retrieveSelectedFiles()
    this.clientContext = SP.ClientContext.get_current();
    var web = this.clientContext.get_web();
    this.selectedItem = SP.ListOperation.Selection.getSelectedItems();
    this.selectedList = SP.ListOperation.Selection.getSelectedList();
    if (CountDictionary(selectedItem) == 1)
    this.listItem = web.get_lists().getById(this.selectedList).getItemById(this.selectedItem[0].id);
    this.clientContext.load(this.listItem);
    this.clientContext.executeQueryAsync(Function.createDelegate(this, onRequestSucceeded), Function.createDelegate(this, onRequestFailed));
    function onRequestSucceeded() {
    str = listItem.get_item('DraftDoc');
    if(str == 'Yes')
    str+="Yes";
    alert(str);
    function onRequestFailed(sender, args) {
    alert('Error: ' + args.get_message());
    Best regards
    Patrick Liang
    TechNet Community Support

  • How do I disable "Exceptions" button for "Block pop-up windows" in Content tab?. I am able to Disable other Exception buttons in this tab using about:config preference.

    Need a way to disable "Exception" button for "Block Pop-up windows" in Tools-> Options -> Content tab. I want to be able to do this for Locking Down Firefox preferences.
    == User Agent ==
    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Win64; x64; Trident/4.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)

    That button doesn't have a pref associated with it, so you can't disable that button with a pref on the about:config page or a lockPref call.
    That only leaves the choice to remove that button with code in userChrome.css
    <pre><nowiki>#popupPolicyButton {display:none!important;}</nowiki></pre>
    See http://kb.mozillazine.org/Editing_configuration#How_to_edit_configuration_files

  • How do I change multiple list items at once in a SharePoint list with ribbon button

    Hi
    I have a sharepoint list and a ribbon button that open a dialog box with buttons to set color on a row
    The problem is that i can only selecet one item at once to set the color. 
    How can i do so it could set all or a couple items att once to the color i want 
    I want to do this with javascript
    here is the code i use to get the item id and the color code is in a seperate js file
    'use strict';
    var clientContext, hostweburl, parentContext, parentWeb, selectedItem, itemId, listId;
    clientContext = new SP.ClientContext.get_current();
    hostweburl = decodeURIComponent(getQueryStringParameter("SPHostUrl"));
    listId = decodeURIComponent(getQueryStringParameter("SPListId"));
    itemId = decodeURIComponent(getQueryStringParameter("SPListItemId"));
    parentContext = new SP.AppContextSite(clientContext, hostweburl);
    parentWeb = parentContext.get_web();
    selectedItem = parentWeb.get_lists().getById(listId).getItemById(itemId);
    $(document).ready(function () {
    clientContext.load(selectedItem);
    clientContext.executeQueryAsync(OnSuccess, OnFail);
    function OnSuccess() {
    $("#Blue").click(function () {
    selectedItem.set_item('Color', 'Blue');
    selectedItem.update();
    clientContext.load(selectedItem);
    clientContext.executeQueryAsync(function () { window.parent.postMessage('CloseCustomActionDialogRefresh', '*'); }, function (sender, args) { alert('Error:' + args.get_message()); });
    $("#Green").click(function () {
    selectedItem.set_item('Color', 'Green');
    selectedItem.update();
    clientContext.load(selectedItem);
    clientContext.executeQueryAsync(function () { window.parent.postMessage('CloseCustomActionDialogRefresh', '*'); }, function (sender, args) { alert('Error:' + args.get_message()); });
    $("#Red").click(function () {
    selectedItem.set_item('Color', 'Red');
    selectedItem.update();
    clientContext.load(selectedItem);
    clientContext.executeQueryAsync(function () { window.parent.postMessage('CloseCustomActionDialogRefresh', '*'); }, function (sender, args) { alert('Error:' + args.get_message()); });
    $("#Transparent").click(function () {
    selectedItem.set_item('Color', 'No Color');
    selectedItem.update();
    clientContext.load(selectedItem);
    clientContext.executeQueryAsync(function () { window.parent.postMessage('CloseCustomActionDialogRefresh', '*'); }, function (sender, args) { alert('Error:' + args.get_message()); });

    Check if below can help you
    http://sp2010batchedit.codeplex.com/
    http://sharepoint.stackexchange.com/questions/35935/use-view-ribbon-custom-action-on-multiple-list-items
    http://webcache.googleusercontent.com/search?q=cache:XqMO-PRLHQIJ:dannyjessee.com/blog/index.php/2014/06/enabling-custom-ribbon-buttons-dynamically-based-on-multiple-selected-item-values-using-refreshcommandui-and-jsom/+&cd=1&hl=en&ct=clnk&gl=in
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <CustomAction Id="DannyJessee.TestCustomAction"
    Location="CommandUI.Ribbon"
    RegistrationId="100"
    RegistrationType="List">
    <CommandUIExtension>
    <CommandUIDefinitions>
    <CommandUIDefinition
    Location="Ribbon.ListItem.Actions.Controls._children">
    <Button Id="DannyJessee.MarkItemsFinishedButton"
    Command="cmdMarkItemsFinished"
    Image16by16="/_layouts/images/kpinormallarge-0.gif"
    Image32by32="/_layouts/images/kpinormallarge-0.gif"
    LabelText="Mark as Finished"
    TemplateAlias="o2" />
    </CommandUIDefinition>
    </CommandUIDefinitions>
    <CommandUIHandlers>
    <CommandUIHandler Command="cmdMarkItemsFinished"
    CommandAction="javascript:MarkItemsFinished();"
    EnabledScript="javascript:EnableFinishedButton();">
    </CommandUIHandler>
    </CommandUIHandlers>
    </CommandUIExtension>
    </CustomAction>
    <CustomAction Id="DannyJessee.TestScript"
    Location="ScriptLink"
    ScriptSrc="/_layouts/15/CustomRibbonButton/CustomAction.js" />
    </Elements>
    If this helped you resolve your issue, please mark it Answered

  • Oracle Apps Sys Admin -- Disabling a button on a form

    Hi Guys,
    I want to disable a button on a form in oracle applications. Normally, i disable a button by goin to that MENU, SUBMENU(if there are any) and take the button's sub-function and add it in FUNCTION and MENU Exclusions in the reponsibility define form.
    But in some forms in Oracle Inventory, i have a NEW button and am not able to find a sub-function for that. NEW and OPEN , two buttons are there . How can i disable or make that button vanish from that form. I know that it can be done thru CUSTOM.pll but without custom.pll , is there a way using this sub-functions or watever.
    help appreciated.
    Thanks

    Yes I know about form personalization, however I still couldn't hide 2 buttons. Open vision database, under purchasing superuser > requisition summary, if you click the Find button it will open Requisition Header Summary window. In that window there are New and Open button. Now, I couldn't hide those 2 buttons cause I couldn't found the name in Item. What's the name of those 2 buttons? Thanks.

  • To Disable 'CREATE' button

    Hi i have a requirement like to disable one CREATE Button(Creating of Business Partner IS-FS-CM) which is in standard ALV report.I can eliminate that button from PF status of that screen but we are not supposed to change the existing code.But that screen is BDT implemented.
    Can you please help out me how to disable that button w/o changing the standard SAP code

    Hi Krishna,
    For example say your PF sataus name is 'STATUS-100' and function code for create is 'CREATE'.
    then in your part of code use the following syntax,
    SET PF-STATUS 'STATUS-100'  EXCLUDING 'CREATE'.
    I hope this will help you.
    Regards,
    Manoj Kumar P

  • Override "Email a Page link" in ribbon button functionality in SharePoint 2013

    Hi,
    I want to override "Email a Page link" ribbon button functionality on the ribbon control.
      <CustomAction Id="Ribbon.WikiPageTab.Share.EmailPageLink"
                    Location="CommandUI.Ribbon"                
                    Title="Custom Email this page">
        <CommandUIExtension>
          <CommandUIDefinitions>
            <CommandUIDefinition Location="Ribbon.WikiPageTab.Share.EmailPageLink">
              <Group
              Id="Ribbon.WikiPageTab.Share"
              Sequence="30"
              Command="ShareGroup"
              Description=""
              Title="$Resources:core,cui_GrpShare;"
              Image32by32Popup="/_layouts/15/$Resources:core,Language;/images/formatmap32x32.png?rev=23" Image32by32PopupTop="-137" Image32by32PopupLeft="-103"
              Template="Ribbon.Templates.Flexible2"
              >
                <Controls Id="Ribbon.WikiPageTab.Share.Controls">
                  <Button
                    Id="Ribbon.WikiPageTab.Share.EmailPageLink"
                    Sequence="10"
                    Command="CustomEmailPageUrl"
                    Image16by16="/_layouts/15/$Resources:core,Language;/images/formatmap16x16.png?rev=23" Image16by16Top="-115" Image16by16Left="-19"
                    Image32by32="/_layouts/15/$Resources:core,Language;/images/formatmap32x32.png?rev=23" Image32by32Top="-137" Image32by32Left="-511"
                    LabelText="$Resources:core,cui_ButEmailLink;"
                    ToolTipTitle="$Resources:core,cui_ButEmailLink;"
                    ToolTipDescription="$Resources:core,cui_STT_ButEmailLinkPage;"
                    TemplateAlias="o1"
                   />
                </Controls>
                  </Group>
            </CommandUIDefinition>
          </CommandUIDefinitions>
          <CommandUIHandlers>
            <CommandUIHandler Command="CustomEmailPageUrl" CommandAction="javascript:alert('Hello, world');" />
          </CommandUIHandlers>
        </CommandUIExtension>
      </CustomAction>
    Any help would be appreciated.
    Rajasekar A.C

    Hi,
    According to your post, my understanding is that you wanted to override the “E-mail a Link” button on the Ribbon.
    I had created a simple demo to override the “E-mail a Link” button on the Ribbon, you can have a look at it.
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <CustomAction Id="Ribbon.Library.Actions.OverrideEmailLinkButton" Location="CommandUI.Ribbon" RegistrationId="101" RegistrationType="List" Title="Display the UniqueId for the list item.">
    <CommandUIExtension>
    <CommandUIDefinitions>
    <CommandUIDefinition Location="Ribbon.Library.Share.EmailLibraryLink">
    <Button Id="Ribbon.Library.Share.EmailLibraryLink.ReplacementButton" Command="ReplacementButtonCommand" Image16by16="http://s10.postimage.org/lhar0oijp/U16.png" Image32by32="http://s17.postimage.org/trf3y2ui3/U32.png" LabelText="Replaced Button" TemplateAlias="o2" />
    </CommandUIDefinition>
    </CommandUIDefinitions>
    <CommandUIHandlers>
    <CommandUIHandler Command="ReplacementButtonCommand" CommandAction="javascript:alert('This button has been replaced.');" />
    </CommandUIHandlers>
    </CommandUIExtension>
    </CustomAction>
    </Elements>
    More reference:http://msdn.microsoft.com/en-us/library/office/ff407619(v=office.14).aspx
    Thanks,
    Jason
    Forum 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]
    Jason Guo
    TechNet Community Support

  • Disable return button

    I have created an action link on main report that opens second report in a new window and second report has a return button on it by default and when i click on it its is taking me to main report in new tab, Is there any way we can disable return button on second report ?
    thanks

    Check this Re: Unable to hide Refresh link in "No Result" view in BISE1 10.1.3.2.1 version

  • How to disable Print button on WebDynpro ABAP ALV

    In WebDynpro ABAP, a standard menu appears around the ALV,  that has a PRINT button and an EXPORT button.
    Is there anyway to disable those buttons????
    Thanks
    John

    Hi John,
    Check the interface if_salv_wd_std_functions. It contains methods which are used to hide the standard ALV toolbar buttons.
    Also refer : Removing "print version" button in alv
    How to hide Print and Filter option from dynamic ALV

  • How Can i Disable this Button (Screenshots)

    Hi,
    I need to disable 2 buttons (Approve - Reject) for a specific responsibility (+see screenshot link below+)
    http://img825.imageshack.us/i/44310429.jpg/
    Path : Intercompany User --> Transactions: Inbound --> Search for transaction --> Update Transaction
    Through Personalize Page, i personalized the button and set it's Render to FALSE but they still appear (+see screenshot link below+)
    http://img801.imageshack.us/i/87584812.jpg/
    Am i missing something? Please Help,
    Your advice is highly appreciated,
    Best Regards,

    Dear Kali Thanks for your response,
    I tried to set the Render FALSE at the site Level , but the buttons are still appearing.
    you mean the "Disable Self-Service Personal" Profile option? it is set to NO
    the outputs as per your :
    exec jdr_utils.listcustomizations(p_document => '/oracle/apps/fun/transaction/entry/webui/UpdateInTrxPG');
    /oracle/apps/fun/transaction/entry/webui/customizations/org/81/UpdateInTrxPG
    /oracle/apps/fun/transaction/entry/webui/customizations/site/0/UpdateInTrxPG
    /oracle/apps/fun/transaction/entry/webui/customizations/responsibility/51450/UpdateInTrxPG
    /oracle/apps/fun/transaction/entry/webui/customizations/responsibility/51451/UpdateInTrxPG
    exec jdr_utils.printDocument('/oracle/apps/fun/transaction/entry/webui/customizations/org/81/UpdateInTrxPG');
    <?xml version='1.0' encoding='UTF-8'?>
    <customization xmlns="http://xmlns.oracle.com/jrad" version="9.0.6.0.0_35" xml:lang="en-US" customizes="/oracle/apps/fun/transaction/entry/webui/UpdateInTrxPG" developerMode="true">
    <modifications>
    <modify element="ApproveButton" userCustomizable="true"/>
    <modify element="RejectButton" userCustomizable="true"/>
    </modifications>
    </customization>
    exec jdr_utils.printDocument('/oracle/apps/fun/transaction/entry/webui/customizations/site/0/UpdateInTrxPG');
    <?xml version='1.0' encoding='UTF-8'?>
    <customization xmlns="http://xmlns.oracle.com/jrad" version="9.0.6.0.0_35" xml:lang="en-US" customizes="/oracle/apps/fun/transaction/entry/webui/UpdateInTrxPG" developerMode="true">
    <modifications>
    <modify element="ApproveButton" rendered="false" userCustomizable="true"/>
    <modify element="RejectButton" userCustomizable="true"/>
    </modifications>
    </customization>
    exec jdr_utils.printDocument('/oracle/apps/fun/transaction/entry/webui/customizations/responsibility/51450/UpdateInTrxPG');
    <?xml version='1.0' encoding='UTF-8'?>
    <customization xmlns="http://xmlns.oracle.com/jrad" version="9.0.6.0.0_35" xml:lang="en-US" customizes="/oracle/apps/fun/transaction/entry/webui/UpdateInTrxPG" developerMode="true">
    <modifications>
    <modify element="ApproveButton" userCustomizable="true"/>
    <modify element="RejectButton" rendered="false" userCustomizable="true"/>
    </modifications>
    </customization>
    exec jdr_utils.printDocument('/oracle/apps/fun/transaction/entry/webui/customizations/responsibility/51451/UpdateInTrxPG');
    <?xml version='1.0' encoding='UTF-8'?>
    <customization xmlns="http://xmlns.oracle.com/jrad" version="9.0.6.0.0_35" xml:lang="en-US" customizes="/oracle/apps/fun/transaction/entry/webui/UpdateInTrxPG">
    <modifications/>
    </customization>
    Best Regards,

  • How can I get a List ID information using JScript on ribbon button click - SharePoint2010

    Dear All,
    I want to display the custom list ID column information on ribbon button click using a JScript.
    For This I have added a JScript in Layout folder in VS 2010 empty project solution and I have put
    the following Jscript code. While running and clicking the ribbon button, it seems like JScript is not
    invoking and not producing any result. It is like control is not going to Jscript file. How can I find out
    the issue???? can anyone please help me on anything wrong with my script or is
    it some-other problem which causes the blank result???
    It is a farm sharepoint2010 solution, debugging is not working in Visual Studio & IE!!!!
    Somebody please help, hard to find the error.....
    Please note the JScript Code: RibAlert.js
    <script>
    '//var siteUrl = '/sites/MySiteCollection';
    var siteUrl = 'http://a5-12457/AllItems.aspx';
    function retrieveListItems()
    var clientContext = new SP.ClientContext(siteUrl);
    var oList = clientContext.get_web().get_lists().getByTitle('Custom List');
    var camlQuery = new SP.CamlQuery();
    camlQuery.set_viewXml('<View><Query><Where><Geq><FieldRef Name=\'ID\'/>' +
    '<Value Type=\'Number\'>1</Value></Geq></Where></Query><RowLimit>10</RowLimit></View>');
    this.collListItem = oList.getItems(camlQuery);
    clientContext.load(collListItem);
    clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
    function onQuerySucceeded(sender, args)
    var listItemInfo = '';
    var listItemEnumerator = collListItem.getEnumerator();
    while (listItemEnumerator.moveNext())
    var oListItem = listItemEnumerator.get_current();
    listItemInfo += '\nID: ' + oListItem.get_id() +
    '\nTitle: ' + oListItem.get_item('Title') +
    '\nBody: ' + oListItem.get_item('Body');
    alert(listItemInfo.toString());
    function onQueryFailed(sender, args)
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    </script>
    Please note the Elements.xml
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <CustomAction
    Id="CustomRibbonButton"
    Location="CommandUI.Ribbon"
    RegistrationId="100"
    RegistrationType="List">
    <CommandUIExtension>
    <CommandUIDefinitions>
    <CommandUIDefinition
    Location="Ribbon.ListItem.Manage.Controls._children">
    <Button
    Id="Ribbon.ListItem.Manage.Controls.TestButton"
    Command="ShowAlert"
    Image16by16="http://a5-12457/IconLib/ICONBTN.jpg"
    Image32by32="http://a5-12457/IconLib/ICONBTN.jpg"
    LabelText="Comapre alert"
    TemplateAlias="o2"
    Sequence="501" />
    </CommandUIDefinition>
    </CommandUIDefinitions>
    <CommandUIHandlers>
    <!-- <CommandUIHandler Command="AboutButtonCommand" CommandAction="javascript:alert();" EnabledScript="javascript:enable();"/> -->
    <CommandUIHandler Command="ShowAlert" CommandAction="javascript:alert();" EnabledScript="return true;"/>
    </CommandUIHandlers>
    </CommandUIExtension>
    </CustomAction>
    <!-- <CustomAction Id="Ribbon.Library.Actions.Scripts" Location ="ScriptLink" ScriptSrc="/_layouts/DocumentTabTwo/RibButton.js" /> -->
    <CustomAction Id="Ribbon.Library.Actions.Scripts" Location ="ScriptLink" ScriptSrc="/_layouts/RibAlert.js" />
    </Elements>

    Dear All,
    I want to display the custom list ID column information on ribbon button click using a JScript.
    For This I have added a JScript in Layout folder in VS 2010 empty project solution and I have put
    the following Jscript code. While running and clicking the ribbon button, it seems like JScript is not
    invoking and not producing any result. It is like control is not going to Jscript file. How can I find out
    the issue???? can anyone please help me on anything wrong with my script or is
    it some-other problem which causes the blank result???
    It is a farm sharepoint2010 solution, debugging is not working in Visual Studio & IE!!!!
    Somebody please help, hard to find the error.....
    Please note the JScript Code: RibAlert.js
    <script>
    '//var siteUrl = '/sites/MySiteCollection';
    var siteUrl = 'http://a5-12457/AllItems.aspx';
    function retrieveListItems()
    var clientContext = new SP.ClientContext(siteUrl);
    var oList = clientContext.get_web().get_lists().getByTitle('Custom List');
    var camlQuery = new SP.CamlQuery();
    camlQuery.set_viewXml('<View><Query><Where><Geq><FieldRef Name=\'ID\'/>' +
    '<Value Type=\'Number\'>1</Value></Geq></Where></Query><RowLimit>10</RowLimit></View>');
    this.collListItem = oList.getItems(camlQuery);
    clientContext.load(collListItem);
    clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
    function onQuerySucceeded(sender, args)
    var listItemInfo = '';
    var listItemEnumerator = collListItem.getEnumerator();
    while (listItemEnumerator.moveNext())
    var oListItem = listItemEnumerator.get_current();
    listItemInfo += '\nID: ' + oListItem.get_id() +
    '\nTitle: ' + oListItem.get_item('Title') +
    '\nBody: ' + oListItem.get_item('Body');
    alert(listItemInfo.toString());
    function onQueryFailed(sender, args)
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    </script>
    Please note the Elements.xml
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <CustomAction
    Id="CustomRibbonButton"
    Location="CommandUI.Ribbon"
    RegistrationId="100"
    RegistrationType="List">
    <CommandUIExtension>
    <CommandUIDefinitions>
    <CommandUIDefinition
    Location="Ribbon.ListItem.Manage.Controls._children">
    <Button
    Id="Ribbon.ListItem.Manage.Controls.TestButton"
    Command="ShowAlert"
    Image16by16="http://a5-12457/IconLib/ICONBTN.jpg"
    Image32by32="http://a5-12457/IconLib/ICONBTN.jpg"
    LabelText="Comapre alert"
    TemplateAlias="o2"
    Sequence="501" />
    </CommandUIDefinition>
    </CommandUIDefinitions>
    <CommandUIHandlers>
    <!-- <CommandUIHandler Command="AboutButtonCommand" CommandAction="javascript:alert();" EnabledScript="javascript:enable();"/> -->
    <CommandUIHandler Command="ShowAlert" CommandAction="javascript:alert();" EnabledScript="return true;"/>
    </CommandUIHandlers>
    </CommandUIExtension>
    </CustomAction>
    <!-- <CustomAction Id="Ribbon.Library.Actions.Scripts" Location ="ScriptLink" ScriptSrc="/_layouts/DocumentTabTwo/RibButton.js" /> -->
    <CustomAction Id="Ribbon.Library.Actions.Scripts" Location ="ScriptLink" ScriptSrc="/_layouts/RibAlert.js" />
    </Elements>

Maybe you are looking for