CASE: use shared parts across several reconciliations

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 :smirk:

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.
Screen Shot 2020-07-14 at 14.53.26

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.
Scherm­afbeelding 2023-11-07 om 10.59.54

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 :muscle:

So whenever you change something in the shared part, that update will be pushed to every reconciliation that calls upon :wink: 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! :slightly_smiling_face:

2 Likes

Looks nice, I guess the current_reconcililiation.name refers dynamically to whichever reconciliation it is used in?

We created similar reusable parts for titles within a single document. We assign the title content to a variable, and then call the part code which always uses the same variable. It’s not ideal, but it’s something. With the shareable part, we could reuse this part for all our reconciliations, instead of having to copy-paste it for every reconciliation.

Hi Wim,

Indeed, that would be a good use case for a shared part! You could continue assigning the variable and right after that include the shared part (instead of copy-pasting every time your code to a new part inside that reconciliation).

Also, you are right about the current_reconciliation.name, it will get the value related to reconciliation in which the shared part is included. The code inside a shared part is going to be executed in the reconciliation (and in the place) where it is included, in the same way as a ‘regular’ part works.

Hi Sven,

Can I use a shared part that is already created by Silverfin and is used in a default template of Silverfin?

Hi @Peter

It’s not possible to add a shared part created by Silverfin to your own custom template.

Kind regards,
Romy