locked
Query count RRS feed

  • Question

  • Hi all, I am t my wits end with trying to figure this out.

    I am trying to get a count from a query that is used to create a pick list. I idea is if the list count = 1 then I want to use that item otherwise show a list.

    myapp.AddEditClockInStaffNew.created = function (screen) {
        myapp.activeDataWorkspace.ApplicationData.qryShiftBySite.execute().then(function (results) {
            var queryCount = results.count;
            //if (queryCount > 1) {
            //    screen.findContentItem("Shift").isVisible = false;}
        });
    };

    The error I get is

    Error

    Cannot read property 'qryShiftBySite' of undefined

    The query is there and its off of one of the tables. It does has a parameter, not sure f that if tripping me up.

    Here really hoping someone can help.

    Scott

    Monday, September 1, 2014 4:49 PM

All replies

  • Hi,

    i think, that you forget the breakets qryShiftBySite()


    myapp.AddEditClockInStaffNew.created = function (screen) { myapp.activeDataWorkspace.ApplicationData.qryShiftBySite().execute().then(function (results) { var queryCount = results.count; //if (queryCount > 1) { // screen.findContentItem("Shift").isVisible = false;} }); };

    Monday, September 22, 2014 7:31 PM