Hi Everyone I have a struct that when I dump;
looks like this;
it can be seen, that
dsName exists in the struct.
Yet the following code (this line is directly below the
writeDump(), complains that “key [DSNAME] doesn’t exist”
dsEntity = entityNew("#qOrigFieldsXX.dsName#");
I have also tried;
dsEntity = entityNew("#qOrigFieldsXX[DSNAME]#");
And, al though I tried on trytCF - and couldn’t replicate it - Is there something obvious that I am missing here?
Don’t forget to tell us about your stack!
OS: WIndows 11
Java Version: 11
Lucee Version: 22.214.171.124
what if you run this:
<cfset dsEntity = entityNew(dataSource="#qOrigFieldsXX.dsName#")>
first thing i would check if the key name “dsName” contains a whitespace with help of this function
Unfortunately still doesn’t work - because there is no key called “dsName”.
That was it - there is a leading space in the keys.
(though I still couldn’t work out how I could trim it / pad it to make it work.)
In our case the struct’s values are always in the same order - so I have gotten around it by using structValueArray() and grabbing the 6th element.
Thanks very much for your help.
It just never occurred to me to check for surrounding whitespace.