Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8205761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:23:16+00:00 2026-06-07T08:23:16+00:00

Alright, this one’s got me seriously stumped, after trying things out for hours with

  • 0

Alright, this one’s got me seriously stumped, after trying things out for hours with the block of javascript below I’m still getting the same error in IE’s javascript debugger.

The error I’m getting is SCRIPT5007: Unable to get value of the property ‘get_id’: object is null or undefined.

And below is my code:

AS.SP.ClientActions.ClientProgramEdit_Status = new AS.SP.ClientActions.ButtonStatus();
AS.SP.ClientActions.Can_ClientProgramEdit = function (groupID) {

var OnError = function (sender, args) {
    AS.SP.ClientActions.ClientProgramEdit_Status.enabled = false;
    RefreshCommandUI();
};

var items = AS.SP.ClientActions.GetSelectedItems();
var count = CountDictionary(items);
if (count === 1) {
    var itemID = items[0].id;
    if (AS.SP.ClientActions.ClientProgramEdit_Status.itemID != itemID) {
        AS.SP.ClientActions.ClientProgramEdit_Status.itemID = itemID;
        AS.SP.ClientActions.ClientProgramEdit_Status.enabled = false;

        AS.SP.ClientActions.GetUrl(function (rootUrl) {
            var fragments = AS.SP.Navigation.ParseUri(rootUrl);

            var ctx = new SP.ClientContext(fragments.path); 
            var web = ctx.get_web();
            var props = web.get_allProperties();

            ctx.load(web);
            ctx.load(props);
            ctx.executeQueryAsync(function () {

                var listId = 'Client Programs';
                var sdlist = web.get_lists().getByTitle(listId);

                var locationID = props.get_item('WL_ITEM_ID');
                var query = new SP.CamlQuery();
                query.set_viewXml('<View><Query><Where><And><Eq><FieldRef Name="len_cp_Location" /><Value Type="Text">' + locationID + '</Value></Eq><Eq><FieldRef Name="len_cp_Client_Status" /><Value Type="Text">Inactive</Value></Eq></And></Where></Query><ViewFields><FieldRef Name="Title" /></ViewFields></View>');
                var items = sdlist.getItems(query);
                ctx.load(items);
                ctx.executeQueryAsync(function () {
                    var item = items.itemAt(0);
                    var itemID = item.get_id();

                    if (itemID == "WL_ITEM_ID") {
                        AS.SP.ClientActions.ClientProgramEdit_Status.enabled = true;
                        RefreshCommandUI();
                    }
                }, OnError);
            }, OnError);
        });
    }
}

return AS.SP.ClientActions.ClientProgramEdit_Status.enabled;
}

My theory is that I’ve done something wrong with my CAML query but at this point I really don’t know, any help with this would be greatly appreciated, thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T08:23:18+00:00Added an answer on June 7, 2026 at 8:23 am

    You are using the items variable twice, once on line 9:

    var items = AS.SP.ClientActions.GetSelectedItems();
    

    And again inside GetUrl:

    var items = sdlist.getItems(query);
    

    There is a name conflict in your execureQueryAsync closure. I would begin by fixing this issue. Which items collection do you want to reference? Do you mean to load the original items variable:

     ctx.load(items); 
     var items = sdlist.getItems(query);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Alright.. I'm struggling with this one.. I've got an image with a transparent hole
Alright thought I would throw this one out there for the crowd to think
Alright, I can't figure this one out. The debugger isn't giving much information about
Alright, this one (3a; sample problem with provided answer) has got me scratching my
Alright, I'm having trouble getting started on this one. I'm trying to use the
Alright, I'm completely stumped by this one. Firefox (FF 11/OS X) is rendering a
Alright, this one's interesting. I have a solution, but I don't like it. The
Alright guys, I really hurt my brain over this one and I'm curious if
Alright, I hope this isn't too broad a question but my curiosity got the
Alright so this is an odd one... I have an application built in ColdFusion

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.