Question
ColdFusion 2016 scheduled tasks not working
Hi Everyone, I have created a scheduled job that deletes the data from db, when i access the file through browse it runs fine, but when i gave the url in schdule task in CFadmin it does not run, it shows that schedule task ran successfully but it does not run.
Code in my cfm file: FormSubmit.cfm
<cffunction name="deleteFileFromDB" returnformat="plain"
access="remote">
<cfargument name="fileId" type="string" required="yes" />
<!--- <cfoutput>Inside Model 2</cfoutput> --->
<cfset myDataSource = "sds_dev" />
<!--- <cfset myDataSource = application.datasource />--->
<cftry>
<cfquery name="deleteFileDetails" datasource="#myDataSource#">
DELETE
from
uploadFileTest
where fileId='#arguments.fileId#'
</cfquery>
<cfcatch>
<cfoutput>Inside Model catch - #cfcatch.message# - #cfcatch.detail# </cfoutput>
<cfabort>
</cfcatch>
</cftry>
<cfreturn arguments.fileId>
</cffunction>
<cfset partsData = deleteFileFromDB('TestFileForFormIDAsForFinalTestCeasar1')>
Deleted File with id:<cfoutput>deletefileInDB</cfoutput>
It run fine when i access the file through browser:
like this, it gives the correct output.
But when i give this url in schedule task it does not run.
Please help.
