Skip to main content

Error Message when running a workflow - Object reference not set to an instance of an object

Comments

18 comments

  • Nico Burgerhart

    The error is in an Assign activity in your workflow. Search your workflow for Assign activities.

    I guess in the Value part (right side) of this Assign activity there is a variable referencing a Nothing value in stead of an object.

    0
  • Permanently deleted user

    Thank you Nico!

    Yes, that is very helpful. I have at least now narrowed it down to where the error is, But no matter what I try I can`t figure it out. It still brings up the same error. I don`t know if it how I have written the code, or if it is how I defined the variable. 

    Still looking... 

    thanks for pointing me in the right direction.

    0
  • Permanently deleted user

    So what is the value on the right hand side of the Assign activity?

    Ralph

    0
  • Permanently deleted user

    Hi Ralph,

    ok, so when I run it in the simulator, the error shows up in the Assign activity and it looks like this:

    I have three snap shots of what I am looking at, the activity builder - left adn right side and then my variables. The images are small so here is the code for the left side: "WARD='" +Ward.ToString() +"'"

    And this is for the right side:  "OBJECTID="+School.ToString()

    My variables are as such:

    btnResult - string

    Ward - Object

    School - Object

    school_query - String

    school_FS - FeatureSet

     

    Hope this helps! thanks for your time!

    /customer/servlet/servlet.FileDownload?file=00P6000000elzcuEAA

    /customer/servlet/servlet.FileDownload?file=00P6000000elzjiEAA

    /customer/servlet/servlet.FileDownload?file=00P6000000em1NPEAY

    0
  • Permanently deleted user

    Hi LJohnstone

    Are you sure that Ward is actually being set to something. Odds are that Ward is actually null and therefore will give issues with the .ToString

    You could probably drop the () off the .ToString also.

    How are you setting Ward?  (Setting  as compared to declaring)

    John, I agree with the use of the Alerts. Problems arise at times when using that strategy due to Alert being a Client-side activity and there may be variables in scope at the time that the Alert that is used that is not readily serialized on the Server-side such as DataTables. When going from Client-side to Server-side and vice versa all variables must be packaged up for transmission to the 'other side'

    Regards

    Ralph

    0
  • Permanently deleted user

    Thank you for getting back to me.

    I know I am going to sound like a fool, but I am not sure what you mean exactly? I am on my own trying to figure this out and I am not a programmer. LOL!

    Take a look at the snap shot below. The Ward will appear in the list, I can select it. It will filter the Schools for that ward and display them in the list. It will let me select a School. I get the error when I click on "Search". I removed the () and it made no difference. I am not sure what else it could be. Could it have something to do with the fact that the Data in the field that I am pulling from has both Text and numbers ie: WARD 10? or could it have something to do with the actual field in the shapefile in the GDB? I took a look at the data. The field is set for string and it is has the correct field name.

    Thanks

    Larisa

    /customer/servlet/servlet.FileDownload?file=00P6000000elzYAEAY

     

     

     

    0
  • Permanently deleted user

    Hi Larisa

    No intent to have people sounding like fools at all. In the design of your form, as shown in your screen shot, do you have something like the following set up?

    /customer/servlet/servlet.FileDownload?file=00P6000000em185EAA /customer/servlet/servlet.FileDownload?file=00P6000000elzXzEAI

    Except in your case I should have had the arrows pointing at the Combobox.

    To make some more progress can you please open your workflow ie the .xaml file, in a text editor and paste the raw text into your next message then we can see a little more clearly what you are doing.

    Regards

    Ralph

     

    0
  • Permanently deleted user

    Hi Larisa

    Yes you definitely need to set the output arguments as below.

    /customer/servlet/servlet.FileDownload?file=00P6000000eltlJEAQ

    See how it goes once you have made that change.

    Regards

    Ralph

    0
  • Nico Burgerhart

    Larisa,

    In the display form "Form to collect user input" you should set the Output arguments: for WARD this is the variable Ward and for SCHOOLS the variable School.

    In the query task Query for Schools you should change thet query service url to " http://www.mappmycity.ca/arcgis/rest/services/MappMyCity/CityofWindsorOperationalMap/MapServer/57", I think.

    Check the map service and layer ids in the Display Schools Featureset. If you want to show your selection in the map, I think Collection Name should be empty here.

    Success.

     

    0
  • Permanently deleted user

    Hi Ralph, 

     

    I realised that I missed a step filling in my output arguments, so I thought...wow, problem solved... but no I added the variable names to the output arguments and I got an error message. I think it is how I build my ComboBox. But I can't see it. This is what I see.

    /customer/servlet/servlet.FileDownload?file=00P6000000eltuzEAA

    /customer/servlet/servlet.FileDownload?file=00P6000000elu20EAA

    0
  • Permanently deleted user

    Gentlemen,

     

    I just wanted to say thank you for all your help, it has been invaluable.  I think I have it working! I can select a ward, get a drop down list of the schools and THEN I can select a school (or all the schools) they show up in a list on the left hand side panel and a popup appears with all the additional information I want shown about the school. The problem is now....the zoom so selected is greyed out, so the user has no way of seeing where the school is on the map? Any ideas how I can get the zoom to working on that pop up?  I am working in Silverlight and HTML5. I have this site developed for both. Here is the link to the Silverlight; 

    http://www.mappmycity.ca/SilverlightViewer_2_0/Viewer.html?ViewerConfig=http://www.mappmycity.ca/Geocortex/Essentials/REST/sites/My_City/viewers/Viewer_Silverlight_20/virtualdirectory/Config/Viewer.xml

     

     

    0
  • Permanently deleted user

    It looks like you did not set 'Return Geometry' = True on the Query Task.

    The School features found do not have Geometry, which I can tell 'Zoom Feature' command is disabled.

    Check it out.

    Munhwan

    0
  • Permanently deleted user

    Hi Munwhan,

    hmmmm I must be missing something? This is what I ahve. I set the return geomerty to True, but nothing changed.

    this is what I am looking at. Thanks!

    /customer/servlet/servlet.FileDownload?file=00P6000000em1KMEAY

    0
  • Permanently deleted user

    ok. now I recommends to use Fiddler (refer https://support.geocortex.com/debug-essentials-using-fiddler-) to check out what the Request and Respond from QueryTask, and all workflow steps.

    If possible, copy and paste your workflow file on this forum so that someone will check it for you.

    Munhwan

    0
  • Nico Burgerhart

    I guess it's because the SHAPE (or GEOMETRY) field is not included in the layer. 

    You should enable this in your MXD and republish the service.

    0
  • Permanently deleted user

    Yes!!!! that was it!

     

    thank you so much everyone for all your help!
    0
  • Nico Burgerhart

    Would only advice you to set the Clear Collection First in your Select Features activity to True. Then an existing selection is removed first.

    0
  • Permanently deleted user
    Good news Larisa, welcome to the learning curve Regards Ralph
    0

Please sign in to leave a comment.