How to change the recurring javascript to include changes to start date AND end date.

  • 0
  • 1
  • Question
  • Updated 11 months ago
  • Answered

As a non-developer, Quickbase provided the following javascript to create recurring tasks. The problem I am having is that is only adjusts the start and not the end date. Any idea how to adjust so it also updates end date?

"javascript:void(window.open('" & URLRoot() &"db/6mztyxu8" & "?a=dbpage&dbid=" & Dbid() &"&rid=" & [Record ID#] & "&datefid=8" & "&pagename=recurring.html','recurring','top=240,left=320,width=400,height=150,location=no,menubar=no,toolbar=no'))"

Photo of Dawn Mikulich

Dawn Mikulich

  • 80 Points 75 badge 2x thumb

Posted 11 months ago

  • 0
  • 1


A simple fix would be to modify the end date to be a formula-date field, to include either a duration, or a reference to a duration field.

Example...
if all you had was start and end date field, you could add a Duration field and a new field called End Date Formula.

Lets assume that not all of your tasks are recurring, and some you want to set manually, others should be driven by the start date and a default duration....

You could write the formula with the condition that if the existing End date field is populated, (which could only happen now if a user filled it out) then the formula would use that as it's value, otherwise it would use the start date + duration to generate it's own end date.

Doing it this way allows you to rely on ONE end date field for reporting without having to choose between automatic or manual. 
Try this formula...

If([End Date]="",([Start Date]+[Duration]),[End Date]))
Photo of Dawn Mikulich

Dawn Mikulich

  • 80 Points 75 badge 2x thumb
Thank you!