AnsweredAssumed Answered

FeatureLayer.setDefinitionExpression failure.

Question asked by bill@poconogis.com on Dec 13, 2016
Latest reply on Dec 14, 2016 by bill@poconogis.com

I have a feature layer that I'm trying to pass a definition to and getting goofy results.

 

My setup is a dojo select which passes a "TYPE" of facility and three Dojo radio buttons for Showing all data for that TYPE and/or all data for that type that is Verified  Y/N. 

If I pick all, it just shows the data for that facility type. This works.

If I pick No verified, it shows all data for that facility type and where the Verified field says 'N', this works.

If I pick Yes verified, it shows all data for that facility type and where the Verified field says 'Y', this does NOT work, This tends to show all facility types where Verified equals 'Y', ignoring my Type requirement.

 

I'm able to hit the REST service manually and "TYPE='ambulance' and VERIFIED='Y'" works. So it's not the service.

I've set alerts and console logs, the correct values are being passed to this switch statement, it seems thesetDefinitionExpression for "Y" is the failure point.

 

 

switch(check){ // Radio buttons set value for check,

   case "N":

      operationsPointLayer.setDefinitionExpression(("TYPE='"+ value +"'") && ("VERIFIED='N'"));

   break;

   case "Y":

      console.log(value +" -- "+check);     //ambulance -- Y //TYPE='ambulance' and VERIFIED='Y'       operationsPointLayer.setDefinitionExpression(("TYPE='"+ value +"'") && ("VERIFIED='Y'"));

   break; case "z":

      operationsPointLayer.setDefinitionExpression("TYPE='"+ value +"'");

    break;

}

 

I've attached the complete page if needed.

 

I've even taken the line where VERIFIED='N' which works and tried VERIFIED != 'N' which didn't work.

 

I'm stumped any ideas would be appreciated.

Attachments

Outcomes