Add calculations, if-then logic, and database queries to template fields
-
Creating really powerful templates requires an ability to embed calculations, "if-then" logic, and database queries in fields.
- For example, when reporting paying an issue fee, it is nice to provide at least an estimated expiration date. If all maintenance fees are timely paid, the patent is scheduled to expire on {Matter.ExpiredDate(MMMM d, yyyy)} or {Matter.FilingDate(+20y MMMM d, yyyy)} + {Matter.PatentTermAdjustment(0)} days, assuming no terminal disclaimer is involved. It would be very nice to be able to perform that arithmetic automatically, along the lines of:
{Matter.ExpiredDate(+{Matter.PatentTermAdjustment}d MMMM d, yyyy)}
- The only current logic capability I am aware of is to specify alternative text to be inserted when a field is empty:
{!No Client Ref Specified!Matter.ClientRef}
It would be great to expand this logic capability.
For example, the due date to file an Article 19 Amendment is the later of {Task.RespondBy(-1m MMMM d, yyyy)} or {Matter.PriorityDate(+16m MMMM d, yyyy)}. It would be better if a template could include something like:
The due date to file an Article 19 Amendment is {LaterOf {Task.RespondBy(-1m MMMM d, yyyy)}, {Matter.PriorityDate(+16m MMMM d, yyyy)} }.
Although the prior example refers to dates, numerical comparisons might be useful, too.
- To report when the next European (3rd to nth) annuity payment will be due requires concatenating: (a) the application filing month, (b) the last day of that month, and (c) the current year (if the month has not yet occurred this year) or the next year (if the month has already occurred this year). But, I know of no way to do anything close to this with the present template document field syntax. I suggest adding support for syntax along the lines of:
{Matter.FilingDate(MMMM dlast)}, {if {Matter.FilingDate(MonthDayOf)} < {General.Now(MonthDayOf)} then {General.Now(yyyy)} else {General.Now(+1y yyyy)} }
or
{Matter.FilingDate(MMMM LastDayOf)}, ...
I realize this is asking for a significant addition to the capability of the syntax parser, essentially turning it into an interpreter. But, we would be able to write really useful templates.
Thanks,
George -
Hi George,
This is a great idea. We will explore this idea. Keep the suggestions coming.
- AppColl Support