I'm having some problems understanding the createObject()
function, which the documentation says is used like CreateObject("component", component-name)
.
In the documentation, it is mentioned that Coldfusion searches for the component in "Directories specified on the Custom Tag Paths page of ColdFusion Administrator"
But it is not working in my case. I have a folder mapped in CF admin for custom tags, inside that folder I am placing a folder named "mycfcs" where my cfc is present named Item.cfc
In the test page, I am creating the object in this way:
<cfset testObj = createobject("component","mycfcs.Item")>
But it is throwing an error "Could not find the ColdFusion component or interface".
Just change mycfcs.Item to Item.
On our development server, we have "D:\DW\CF_stuff\CustomTags" specified as the custom tag location. I have a file located at, "I:\CF_stuff\CustomTags\Components\CompareData\DW-ScheduleBookdan.cfc". If I run this code:
I see the object's properties and methods.
What are you doing differently?