Xx is undefined in a CFML structure that is referenced as part of an expression
I am getting this error on one of my pages: Item 9 is undefined in a CFML structure that is being referenced as part of an expression . I even tried to dump this particular structure and the result is the same.
<cfdump var="#(request.session.cust.dra_info[versionid].bm[gradecd]#">
[VerionID] is the reason why I am getting this error. Versionid may appear as 9, which does not exist. This versionid and gradecd comes from the request. Here is a dump of this request:
Resetting the structure gives me the result below:
<cfdump var="#request.session.cust.dra_info#">
Any help / suggestion how should I handle this error?
source to share
This error means "You are passing a value (in your case 9) that is not in the structure." This value can refer to versionId or gradecd .
You only need to pass in the values ββthat are available in the structure. I can't tell you how to do this without looking at the code.
EDIT
You can do this
<cfif structKeyExists(request.session.cust.dra_info,"#versionId#")>
<cfdump var="#(request.session.cust.dra_info[versionid].bm[gradecd]#"><cfabort>
<cfelse>
<cfdump var="not ok- error handling code"><cfabort>
</cfif>
source to share