Xmerge coding query
- 2 months ago
Thank you as always. I will give this a crack, and it should work for my purpose as I will be sending automated monthly reports from IPS to our clients approximately mid month.
Thanks luke.watson3 - I am definitely not a champion coder and had to use a lifeline for this one. 😄
The tricky bit with this is that email syntax differs from xmerge syntax used in word templates. So while <:= dateutils.dateToStr(dateutils.getEndOfLastMonth(int(today)), format='%Y %B'):> works in a word document, it doesn't work in an email template.
For email try:
<:=datetime_merge.fromordinal(datetime_merge.toordinal() - 30).strftime('%Y %B'):>
⚠️ There is a limitation though - this code will merge the month based on the date that was 30 days ago (-30). So if the email is sent on the 15th of the month, you will likely get the result you are after, but if sent on the 31st day of a month, it won't work as expected.
Let me know if the code I provided doesn't do what you need it to and we can brainstorm some alternatives.
Otherwise, I'd love to hear from any expert coders out there who may have an alternative solution for email syntax that might work in this instance.
And while the answer to your specific question Luke, was not in our Community resources, for others who might be reading this - there is a reasonably comprehensive library of codes in the Xmerge Library in Community that can be useful when trying to source codes for your templates. I've also found the blog articles on the following website to be super useful in helping me understand how xmerge code functions - https://www.createsomething.com.au/blog/
And, while again it didn't help me in this particular instance - Chat GPT or similar has also helped me work out codes in the past!
Recent Discussions
Using Xplan Client Portal as a Document Vault
Hi All, I'd be interested to know if any other practices are using the Xplan Client Portal as a Document Vault for clients to upload important documents such as Wills, PoA's etc? Our clients love...sharyn.evans83 days agoValued Supporter68Views4likes6CommentsWant to know exactly what your client has updated in their digital fact find? Now you can!
Fact find comparison report is now available to all users Background Client Portal allows users to provide their clients with a digital fact find to complete for new and existing clients. The dat...36Views6likes2Comments🤓 Xplan Hint: Client List - generating a report
Did you know you can customise your client search list and export the list into either PDF or CSV? Previously only the PDF version was available from this screen, but now you can export the data into...laura.capozzi5 days agoIress Contributor64Views5likes6CommentsThe Offshoring Blind Spot: How Poor Systems Cripple Profitability
Australia is experiencing a unique mismatch: adviser head-count has fallen by roughly 40 % since 2019, yet the pool of advice-seeking households keeps growing as 3.6 million baby-boomers move deeper ...marklewin17 days agoValued Supporter34Views3likes1Comment