When you want to link to another reconciliation (a linkto eg), you always need to check if that reconciliation is added in the company file (ergo if it exists or not). If not, this could lead to Liquid errors being shown in your template, which is to be avoided at all costs (obviously).
This can be done by the so-called exists?
method on the reconciliation drop. Here’s a case to have something like this:
Here’s the code to get just that, in which an important coding guideline stands out: always check if something exists if you want to access it
{% comment %}create needed vars{% endcomment %}
{% assign fixed_assets = period.reconciliations.vaste_activa %}
{% comment %}check if the recon exists or not{% endcomment %}
{% assign show_fixed_assets = false %}
{% if fixed_assets.exists? %}
{% assign show_fixed_assets = true %}
{% endif %}
{% comment %}display info header with link to the FIXED ASSETS reconciliation{% endcomment %}
{% if show_fixed_assets %}
{% ic %}{::infotext}
Numbers are directly taken from the reconciliation {% linkto fixed_assets %}{{ fixed_assets.name }}{% endlinkto %}.
{:/infotext}{% endic %}
{% endif %}
An overview of other methods on that specific reconciliation drop.
So every time when you access a specific method of the reconciliation drop, always check first if the reconciliation exists or not. Even when you are certain that the reconciliation would always be part of a workflow: you have to keep in mind any admin-user can deflect from a certain workflow, and create a custom workflow, in which that reconciliation is not part off.