For an internally generated template, I made an if-then structure to determine the (at most) four prepayment dates for a company.
I’d like to add this function as a method to the period drop (in order to not having to repeat myself when this functionality is used in another template); this is very comparable to putting a UDF in a module in VBA (Excel). Is this possible and - if yes - how?
You can take the 4 dates into 4 result-tags (if it’s generated in a recon template), so that it can be displayed in other templates. Or did you mean you wish to take the logic-code with you in other templates?
Yes, it’s the logic-code that has to be available to other templates (so it can calculate with the dates of the period in question for the company in question) without having to repeat myself every time.
This works (although I have two small issues with this:
1.First of all, if I replace my code in the way described above, there’s an empty line above the output (which isn’t there when I define the function in the template itself); how can I solve this?
2.Is it possible to provide input parameters to a function this way (not attached to drops like period or company for example)? An example would be fiscal parameters defined in another template which would be used to make further calculations)?
I think it would be best to post your code because use of my example code wouldn’t generate an empty line unless there’s no result tag to begin with? Then you could check if it there or not
no, not really. But I don’t see a problem in this; you could always create a template named “settings” or something and guide users towards it, to fill in the needed info, no?
BUT avoid using the stripnewlines around your capture ? They don’t have a use in here IMO (if you want to use them, it’s better to use them within the capture).