Municipal Addresses - Part 2
Hi everyone,
Here is the second part to my "narrowing municipal numbers based on street" sellection. John Nerge recommended using a Combo Box and the Cascading ID to load the results of the Autocomplete Box and it worked like a charm. My next question is how would I write a Where clause in the QueryTask that captures both the Street Name (defined as a String variable) and the municipal number (defined as an Object variable)? As of now I can start type the street name and pick from an autofill list, then pick from the numbers associated with that street.
During the selection process, my current Where clause ends up selecting ALL the parcels with the municipal number picked.
Thanks again for any assisstance,
Gary
0
-
Usually the trick to using the Combo Box output is to use the .ToString() command to convert the Object to a String.
Any chance you can post your workflow xaml here? It'll be easier to troubleshoot if we can play around with it.0 -
Hi John,
Thanks for your response. Forgive my "newb-iness", but what is the best way to post in the forum?
g0 -
Great question. If your workflow is short enough, you can just open the xaml in a text editor and paste it directly. But these posts have a character limit, so that doesn't always work.
I prefer to store my workflows in a Google Drive folder (GitHub and other sites where you can store code are fine, too):
https://drive.google.com/open?id=0B_hHHiqcTKMfWUYybFN0UG1CNXM
Posting them this way also makes it easier for me to find workflows I've posted vs. having to search my past posts.
I save my workflows as .txt files so that if someone downloads and opens them they don't try to execute. Instead you can just open a text editor, paste the code in, and save the new file as a .xaml and voila, new workflow.0 -
Ah, okay, so you're using the syntax of the Where Clause used in the Display Form. But for Query Task, you should use a regular SQL query format.
So if you're trying to select the record where the street name and number match, here's what your Query Task Where Clouse should look like using your output arguments from the Display Form:
"Street_Nam = '" & resultStreetName & "' AND " & "Street_Num = '" & resultMuniNumber & "'"
So if your user used the street name Main St, and the number 100, that Where Clause would calculate to:
Street_Nam = 'Main St' AND Street_Num = '100'0 -
Hi John,
Thanks for breaking down the QueryTask Clause for me. I am still running into a compiler error (screenshot below).
Is this error occuring because the resultMuniNumber variable has been defined as an Object and needs to be convert to a string before it can be included in the Clause?
Thanks again for you assitance and patience.
Gary
_img_ alt="User-added image" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=907f2000000g05e&feoid=Body&refid=0EMf2000000kCyP" _/_img_0 -
Whoops, my bad, forgot to include the .ToString() in the sample I posted. Here's the corrected version:
"Street_Nam = '" & resultStreetName & "' AND " & "Street_Num = '" & resultMuniNumber.ToString() & "'"0 -
Hi John,
Looks like that did the trick! Thanks for all your help.
Gary0
Please sign in to leave a comment.
Comments
7 comments