Ever found yourself in a position where you were creating a set of reconciliations, and code you did in the previous template, needs to be done in the next one as well?
Yes, think we got you covered with the next case
Okay, let’s start off with an easy example:
What I need, is to display a certain sub-title within the template for export reasons. And I also would want each reconciliation be printed as portrait mode.
Then I will find myself doing this, in every template, over and over:
{% comment %}create for export header title and date period{% endcomment %}
{% assign end_date = period.end_date | date:"%Y-%m-%d" %}
{% assign name_recon = current_reconciliation.name %}
{% capture title_recon %}{{ name_recon }} {{ end_date }}{% endcapture %}
{% comment %}force recon to portrait mode{% endcomment %}
{% changeorientation "portrait" %}
{% comment %}show title in export{% endcomment %}
{% nic %}
{::font size='l'}**{{ title_recon }}**{:/font}
{% endnic %}
Obviously, you don’t want that, because if you need to change anything, you need to do that for every reconciliation where you use that code.
Granted, you could mis-use result tags, and put the capture within a result-tag to be displayed everywhere else. But that’s not what result-tags are made for (let alone having an unneeded impact on the loading of the workflow, and trying to avoid circular references).
But here it is: within your Silverfin environment, you can now create shared parts!
Think of it as a part of a template that only has to be made once on firm level, and can be accessed from anywhere else in a reconciliation. This to avoid duplicate coding, and save lots of timing with it!
How?
On firm level, you can create one (see screenshot above), and simply add the code you wish to be executed in every (or a bunch) of reconciliations there.
After saving the shared part, within all reconciliations you’ll see Manage shared parts
next to all parts:
Click on it, and select the shared part you wish to add to (or remove from) your reconciliation.
As a last step, you’ll need to add this to your reconciliation code in which you want the code to be executed from:
{% include "shared/aa_title_export" %}
So this will actually put the code in which you place it, and there it’ll be executed.
Save it, and you’re all done
So whenever you change something in the shared part, that update will be pushed to every reconciliation that calls upon and saving you lots of time, and easier to maintain updates of your customer templates!
Some thoughts/guidelines though:
- don’t put everything into one shared part, but rather split them in several categories (this to avoid too much updating of one shared part, eg; a shared part for translations, a shared part for headers, a shared part for general variables, and so on… )
- name your shared parts logically (and also make them unique, as Silverfin offers shared parts as well, so it might be a good idea for now to name it unique, eg. starting with the initials of your firm)
- shared parts are not yet available if you develop in partner environments
- shared parts cannot yet be removed from a reconciliation (you could delete the statement that calls upon the shared part however)
- shared parts need to be activated by Silverfin support (you can do just that by sending a mail to support@silverfin.com with request Activation shared part by Silverfin developers)
If you have any questions, don’t shy away to ask here!