Custom Template Fields / params
Submitted by Ben_Charlton on Tue, 02/08/2022 - 17:34
I was looking at how we add custom template fields that can be used across multiple reports. Intially I thought a localization file would be the best way - but this requires a post install customization to the web app each time we roll out an update.
Use cases are things like an Online booking URL and I am sure as I move through I will find other areas requiring these fields
$R{text.onlineBookingURL} for example.
I think its outside the scope to keep expandin the Letterhead and document control. In fact there are probably fields in that archetype that could be merged into a properties file
Re: Custom Template Fields / params
Service urls are dynamic so shouldn't be hard coded in an archetype or configuration file.
Perhaps there needs to be a function to resolve a url based on the Practice Base URL field. Open to suggestions but could include:
E.g., for Online booking: application:url('/ws/booking/v2')
As for other configuration options, these are best encapsulated in archetypes.
For 2.4 there will be support for global settings. These currently aren't accessible to reports, but that can be added. If you have settings you want to include, let me know.
Re: Custom Template Fields / params
Completely agree with the concept of not hardcoding dynamic properties. The url was sort of an example
Context was use in an email template - to create a HTML button that dynamically lnked to the clinics online booking webpage (not the api)
Given that sometimes this URL may not be based on the application base url I had thought some sort of dynamic property would be appropriate
In my head conceptually they are linked to the practice location. Possible as a 1 to many relationship with
CODE:NAME:Description type setup as below
Lookup.locationProperty
/id
Link this to practice location as a list on the in the config.
Create a jxpath method to access these properties:
location:property(CODE)/name etc
We could create a standardized set of properties that is loaded at install/upgrade and require users customise them to make them available via jxpath to reports.