Link to home
Start Free TrialLog in
Avatar of aj10101
aj10101

asked on

record dependent on other records

Hello Experts,

I need to write a scheduling program, where a task can be dependent on another task. Each record will have a start date, number of days, and end date(end date is a calculation of start date + number of days.), dependent on(True or false), and Dependent on Record Number(The ID of the task that the record is dependent on).

Now if phase two is dependent on phase one, The phase two date can not be less than phase one end date.

Now my issue is if the user where to go back and edit the phase one date, say extend it by 15 days, I would need for the phase two to automatically move forward so that its start date does not occure prior to the phase one end date. (This would work the same way Microsoft Project works).

Thanks,
AJ
Avatar of ECohen
ECohen

This probably needs to be done at the user interface level.  Since you will know what task the user is basing the second task on, you'll be able to police for this.  If  the user tries to input a dependent date in the past, you simply won't allow that to go into the database.  There are several ways I could think of to carry out the check, but the bottom line is you'll just test against the date of the original task, and then let the user continue only if the date for part two is after the date from the initial task.  You will find the datecompare() function in Coldfusion useful for doing this.  The basic syntax is DateCompare("date1", "date2" [, "datePart"]) -- but you'll need to decide what datepart to use, maybe minutes, hours or days...depending what you've got in mind.  

HTH.

i guess u can have the schedules set up in your CFSCHEDULE !

for your records of phase one & two.
u can have a trigger at teh back end [MSSQL] / u cld also use procedures for this.

so that everytime the user updates the date of the phase one- the dates of phase 2 are automatically shifted.

hth

let me know ...

K'Rgds
Anand

ASKER CERTIFIED SOLUTION
Avatar of procept
procept

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of aj10101

ASKER

Thanks procept,

That seems like an elegant solution. I will play with it this weekend.

Best regards,
AJ