Home › Forums › Classic DFFS › Number of Days to Calculate Read Only Due Date Field
Tagged: #DFFS #Calculateduedate
- This topic has 1 reply, 2 voices, and was last updated 4 years, 4 months ago by
SteveE.
-
AuthorPosts
-
-
November 11, 2021 at 15:55 #35091
Hello,
I have three fields that I need to link together.
– Session Start Date (Date Picker)
– Number of Days
– Task Due DateThe user fills out the Session Start Date field (Parent List) and will click the Add Task button which opens the Task form (Child List). The user then chooses a task from the Task Name dropdown field (The Lookup list). Once they choose their task they need to add a number to the number of days field. -1 would be the day before the session start date, 0 would be the day of the Session Start Date and 5 would be 5 days after the Session Start Date. I need for the day entered to populate the read only Task Due Date field as it relates to the Session Start Date field. The Task Due Date field would be calculated using calendar days.
Example 1.
Session Start Date – 4/10/2021
Number of Days – -10
Task Due Date – 5/31/2021Example 2.
Session Start Date – 8/17/2021
Number of Days – 16
Task Due Date – 9/2/2021Can this be done using DFFS? Any help you can provide would be greatly appreachiated :).
-
November 12, 2021 at 15:56 #35104
First populate the Session Start Date field in the child from the parent using vLookup settings.
In the child Custom JS section add this code (changing the field names to match yours):
function SetDate(){ var StartDate = spjs.utility.getDateFieldAsDateObject("SessionStartDateFIN"); var DayNumber = Number(jQuery("#dffs_NumberofDaysFIN input").val()); spjs.utility.setDateFieldFromDateObject("TaskDueDateFIN",StartDate,DayNumber); }Then in the child create a rule that triggers when the Number of Days field is changed and add SetDate in the Run these functions section.
Your math in your examples doesn’t add up so that part was confusing, but this works for the request in your explanation.
-
-
AuthorPosts
- You must be logged in to reply to this topic.