Hello, I was using this code to select directors or permanent representatives of companies. Can someone help me to adapt it with the new reconciliation “Legal Report - Shareholders/Associates & Managers / the Board of Directors”?
I would also like to be able to put “Mr./Ms.” according to gender.
If your code worked before, that should still be the case. All these fields still have the same name in the database.
As for the gender, you can add it in front of the name, but this changes the options and will break the existing input. The code actually mentions “values”, this was intended to use as option_values, by using option_values you can change the options without breaking the input.
So as not to break you current input, you would need to use the current options (names) as option_values, and then create new options with the genders attached.
I’ve taken the liberty to also add a basic translation, but this is not necessary if you would only use 1 language.
You may notice I also replaced persion.id with person.persistent_id.
This is just a good practice, as the id changes every period, while persistent_id remains the same.
(as the name implies )
No worries, we’re happy to help.
The main difference you’ll notice code-wise with the new templates, is that you can now access results from them. (you can find an overview here!)
The code for this template is open source, so if you open the reconciliation text on the “template tab” in your Silverfin environment, you can find the name of any input. Function is person.custom.function, but note that it has a default value as well, which isn’t stored in the database. You’d have to repeat the logic that was used to come to this default.