Skip to main content
December 14, 2011
Answered

Element undefined in structure error

  • December 14, 2011
  • 1 reply
  • 1368 views

Receiving an error when I run code that says "Element Assessment is undefined in a CFML structure referenced as part of an expression".  I cannot paste code in the editor for some reason.  Please click http://pastebin.com/2A059LEE to go to source code.  Please click http://pastebin.com/31a2qEYS to go to error page.  Any assistance would be greatly appreciated. 

    This topic has been closed for replies.
    Correct answer Owainnorth

    When I do a cfdump the value is in the resultset. Please view the following link: http://pastebin.com/NiDPJ23g.


    In fact no, it's simpler than that. On line 53, you set the value in a struct called "structJobType". On line 79, you're referencing a struct called "structJobStatus". Completely different struct.

    1 reply

    Owainnorth
    Inspiring
    December 14, 2011

    Seems pretty clear to me, you've tried to reference the Assessment variable which hasn't been set yet.

    I'd guess it's at line 79:

         <cfelseif arguments.type eq structJobStatus["ASSESSMENT"]>

    December 14, 2011

    Thanks. Correct me if I'm wrong, but is the variable not set on line 53?

    Owainnorth
    Inspiring
    December 14, 2011

    Only if that value exists in the "data2" query.