AnsweredAssumed Answered

ca_reportQuery result always blank

Question asked by ScottLewis76041305 on Mar 23, 2015
Latest reply on Apr 8, 2015 by Lindsay_Estabrooks

i build the data object ("autopopulateRequestedForManager") with this query, which uses system defined variable: USER_ID, which doesn't prompt the user.

 

Select man.last_name +', '+man.first_name as manager_name FROM ca_contact man, ca_contact reqFor WHERE reqFor.userid = %USER_ID% AND man.contact_uuid = reqFor.supervisor_contact_uuid

This works, when I test it in Catalog.

 

My form script always outputs "no result" and "did nothing"

 

  foundManager : function(result) {

    if(result.length > 0) {

      alert(result[0].manager_name);

      ca_fdSetTextFieldValue(formId, "manager_name", result[0].manager_name);

    } else alert("no result");

    return true;

  },

 

  doNothing : function() {

    alert("did nothing");

    return;

  },

 

  autopopulateManagerOnLoad : function() {

    try{

      var result = []; //if i don't declare it throws a 'result' is undefined error

      ca_reportQuery("autopopulateRequestedForManager", {}, ca_fd.js.foundManager(result), ca_fd.js.doNothing());

    } catch (err) {alert(err.toString());}

    return;

  } 

 

What am I missing?
Thanks!

 

Outcomes