Hello,
I’m trying to set up a new insert method as following :
<cfinclude template="#request.stMapping.strCFC#.admin.DB_MSSQL"
<cfset var local = structNew()>
<cfset local.start_date = ARGUMENTS.action.get_value(“start_date”)>
<cfset local.end_date = ARGUMENTS.action.get_value(“end_date”)>
<cfset local.event_name = ARGUMENTS.action.get_value(“event_name”)>
<cfset local.details = ARGUMENTS.action.get_value(“details”)>
<cfset local.categoryid = ARGUMENTS.action.get_value(“categoryid”)>
<!— <cfset local.is_publicyn = ARGUMENTS.action.get_value(“is_publicyn”)>
—>
<cfif local.status eq “inserted”>
<cfset request.scheduler.sql.query(“INSERT INTO TBL_EVENTS(start_date,end_date,event_name,details,SY_UUID,categoryid,is_publicyn)VALUES(’”&local.start_date&"’,’"&local.end_date&"’,’"&local.event_name&"’,’"&local.details&"’,’"&local.SY_UUID&"’,’"&local.categoryid&"’,‘1’)">
<cfset ARGUMENTS.action.success()>
<cfset scheduler = createObject(“component”,request.dhtmlxConnectors[“scheduler”]).init(request.dhtmlxConnectors[“datasource”],"","","")>
<cfset scheduler.event.attach(“beforeInsert”,insert_related)>
<cfset scheduler.render_table(“TBL_EVENTS”,“event_id”,“start_date,end_date,event_name,details,SY_UUID,categoryid,is_publicyn”)>
The problem is that i have an XML error :
Error type: LoadXML
Description: Incorrect XML
Can you help please.
Regards
Abderahmen
Hi
The xml error means that cfm page is incorrect and there is server error.
If you use the exact code that you’ve sent to us - there is incorrect cfm code in some places.
The list of bugs in the code at first site:
1) <cfinclude template="#request.stMapping.strCFC#.admin.DB_MSSQL"
the “>” is missing in the end of the cfinclude tag.
2) <cfset request.scheduler.sql.query(“INSERT INTO TBL_EVENTS(start_date,end_date,event_name,details,SY_UUID,categoryid,is_publicyn)VALUES(’”&local.start_date&"’,’"&local.end_date&"’,’"&local.event_name&"’,’"&local.details&"’,’"&local.SY_UUID&"’,’"&local.categoryid&"’,‘1’)">
The “)” is missing in the end of the line (before “>”).
Correct one:
<cfset request.scheduler.sql.query(“INSERT INTO TBL_EVENTS(start_date,end_date,event_name,details,SY_UUID,categoryid,is_publicyn)VALUES(’”&local.start_date&"’,’"&local.end_date&"’,’"&local.event_name&"’,’"&local.details&"’,’"&local.SY_UUID&"’,’"&local.categoryid&"’,‘1’)")>
After fixing these two bugs the xml is generated correctly.
To check for other bugs you can try to call the page in browser /events.cfm, where “events.cfm” is the template that contains the code you’ve sent. If there are any cfm compilation errors you’ll see them.
Best regards
Support