Error using ESRI Print Task service

Discussion created by steinj14 on Feb 28, 2013
Latest reply on Feb 25, 2014 by Meengla

I'm encountering an error using the ESRI print task ( that I'm having trouble resolving.

My app is here:

The error only occurs after the data grid is dislplayed (e.g., via the app's Find Parcel functionality) and I then try to Print.

The apps returns the error:

[INDENT](in Firebug): TypeError: cyclic object value

(in IE developer tools): SCRIPT5034: Circular reference in value argument not supported
PrintTask.js, line 19 character 2208[/INDENT]

The relevant code is:

function doFindParcel(searchText) {
 console.log("-->inside doFindParcel");
   //create query task with url to map service.
 var queryTask = new esri.tasks.QueryTask(configOptions.parcellayer);
 var query = new esri.tasks.Query();
 query.returnGeometry = true;
 query.outSpatialReference = map.spatialReference;
 query.outFields = configOptions.parceloutfields;
 console.log("searchText: " + searchText);
    //set the search text to find parameters
    //findParams.searchText = searchText;
 searchby = dijit.byId('searchby').value;
 searchfor = searchText.trim(); //trim the string in case user puts leading spaces in.
 console.log("searchby: " + searchby + ", searchfor: " + searchfor);
 //Search for the keyword at the beginning of the field so it will use the indexes.
 //If search with the wildcard in the front, it does a complete table scan which is slow.
 switch (searchby) {
  case "folio":
     //query.where = "OBJECTID = 1";
     //query.where = "[FOLIO] = '194001.0000'"; 
     //query.where = "[FOLIO] = '" + searchfor + "'"; 
     query.where = "[FOLIO] like '" + searchfor + "%'"; 
  case "owner":
     query.where = "[OWNER1] like '" + searchfor + "%'";
  case "site_addr":
     query.where = "[STR_NAME] like '" + searchfor + "%'";
 console.log("query where: " + query.where);
    //Show the dialog box to containing "searching" message (so user knows app is doing something).
    queryTask.execute(query, showParcelResults, showParcelError);
function showParcelResults(results) {
 console.log("-->inside showParcelResults");
   //resultcount = results.length; //this worked for the FindTask, but not for QueryTask.
   //think query task returns result objects but find task returns features?
   resultcount = results.features.length;
   console.log("# of query result objects passed into function: " + resultcount);
   features = results.features;

 //Close the 'searching' dialog box. 

 if (resultcount > 0) {
  //console.log("-->inside resultcount loop");
  //Open the dialog box to display results in a grid. 
 //Alert user in case parcel is not found, 9/11/12 jms.
 else {
  dialogAlert("Find Parcel", searchby + ": " + searchfor + " was not found.");

function showParcelError(error) {
 //Close the 'searching' dialog box. 
 console.log("Find Parcel", "Error in 'Find Parcel': " + error);
 dialogAlert("Find Parcel", "Error in 'Find Parcel': " + error);

//Zoom to the parcel when the user clicks a row
function onRowClickHandler(evt){
 console.log("-->inside onRowClickHandler");
    var clickedTaxLotId = grid.getItem(evt.rowIndex).FOLIO;
    var selectedTaxLot;
    var symbol = new esri.symbol.SimpleFillSymbol(highlightfillSymbol);

      if((graphic.attributes) && graphic.attributes.FOLIO === clickedTaxLotId){
       //Setting the symbology here sets it for only the feature clicked on.
        selectedTaxLot = graphic;
    var taxLotExtent = selectedTaxLot.geometry.getExtent();

function showResultsGrid(features) {
 //This function works with an array of result that the task returns
 console.log("-->inside showResultsGrid");
 console.log("# of features passed into function: " + features.length);
 var resultcount = features.length;

 //Open the dialog box to display results in a grid.   
 //Display number of results in the dialog box header.
 dojo.byId('rowcountdisplay').innerHTML=resultcount+" parcels.<br/>"+ configOptions.selectparcelnote + configOptions.maxrecordcount + ".";
 //var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([98, 194, 204]), 2), new dojo.Color([98, 194, 204, 0.5]));
 var symbol = new esri.symbol.SimpleFillSymbol(resultfillSymbol);

 //create array of attributes and add graphic to map.
 items =, function(feature){
  //console.log("-->inside create array of attributes");
  //var graphic = result.feature;
  var graphic = feature;
  //Setting the symbology here sets it for all features in results.
  //console.log("after adding graphic");
  return feature.attributes;
 //Create data object to be used in store
 var data = {
  identifier: "FOLIO", //This field needs to have unique values
  label: "FOLIO", //Name field for display. Not pertinent to a grid but may be used elsewhere.
  items: items
 //Create data store and bind to grid.
 var store = new{ 
  data: data
 //Grid used in the results pop-up dialog.
 grid = dijit.byId('grid');
 //Grid used for exporting the data (containing additional fields) to a csv file.
 var gridexport = dijit.byId('gridexport');

I have no idea what the problem is or how to debug this. Can anyone assist or offer suggestions?

Thanks in advance,