• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

schedule task

Guest
Apr 07, 2007 Apr 07, 2007

Copy link to clipboard

Copied

hi i have a page of code which includes a form, this page works fine when entered into the address bar, but not as a scheduled task,

can schedule task process forms?
TOPICS
Advanced techniques

Views

649

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 07, 2007 Apr 07, 2007

Copy link to clipboard

Copied

Schedule tasks process pages, not part of it (i.e. : a form inside a page). You can add the URL parameters you need and control de code flow to execute the part of the page you need.

Regards

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 07, 2007 Apr 07, 2007

Copy link to clipboard

Copied

ok thanks, but still not sure how i can process a form, ie i need to insert csv files into my table, how would i change my code to do this with a scheduled task?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 08, 2007 Apr 08, 2007

Copy link to clipboard

Copied

create an action page that uses URL variables and then the page will run via scheduler.

as noted, a form cannot really be processed unless there is interaction with a user ... but CF pages passed URL variables can process on their own.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 08, 2007 Apr 08, 2007

Copy link to clipboard

Copied

ok thanks i undrstand now, but will the url variables be able to hold currentrow information

ie the form i have now gets its values from a csv file, looping through each record, can that work with url?

also the schedule page loops through multipul csv files, so if i have a action page how can the schedule page loop through the next csv?

what i need to do is

1. loop through email csv attachments
2. read the csv
3. insert the csv information into my database
4.delete email
5. go back and loop through the next csv

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 08, 2007 Apr 08, 2007

Copy link to clipboard

Copied

This is part of that CFPOP thing you are working on I guess ...

If the data is not time sensitive, I would probably suggest doing something a bit different and running the task at set intervals ... maybe once or twice a day or something.

Based on what I have skimmed through regarding that project, I think you should have the CFPOP service save the attachments to a set directory reserved for the CSV files (I think you are doing that already). Make sure they have a CSV extension.

Separate from above, in the task page, use CFDIRECTORY to get a list of all the CSV files, filtered by *.CSV, so it ignores any other possible attachments that show up.

Loop through this list and read each file using CFFILE then add the data from that CSV to the database.

Once completed, move to the next file.

When all the CSV files in that current list are read and entered, use the list again to delete the files already used so they do not get entered again.

This is a very grassroots approach to what you want to do, but would run w/o any need for forms and could process within a silent task page via scheduler.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 08, 2007 Apr 08, 2007

Copy link to clipboard

Copied

ok thats sounds good, but i need to run this every 60 seconds, as when i receive the email whith the attachment i need to upload it as quick as possible.

if this would work every 60 secs, can you post some example code to get me started.

just another question is there another way of inserting a csv into a database other than using a form?

thanks for your help

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 09, 2007 Apr 09, 2007

Copy link to clipboard

Copied

LATEST
i just found the code attached, to read the csv file, but i am getting a error of

any ideas what i need to change, and will this work on a scheduled task?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation