#1689 - Merging data into the header/footer
Hi, is there any way to merge data into the header/footer areas of a Word document template? And does the module support merging into Text boxes with MS Word?
Thanks for your time and patience
Hi, is there any way to merge data into the header/footer areas of a Word document template? And does the module support merging into Text boxes with MS Word?
Thanks for your time and patience
9 years ago
Hi there,
In the header and footer you only can user global variables of Sugar, variables like [onshow.xxx]. You can not use fields from the dataset of the document.
For example, to show the global variable of Sugar “current_user”, you can put the variable [onshow.current_user.full_name] (this is equivalent to $GLOBALS['current_user']->full_name value). Other example is [onshow.sugar_version]
If you need a variable which is not a Sugar global variable, you can create an event into the calculated fields of your module like the next example:
function BeforeMergeBlock() {
$GLOBALS['TemplateCurrentUserName'] = $GLOBALS['current_user']->full_name; }
With this code you can use the variable [onshow.TemplateCurrentUserName] variable into the header or the footer
And yes, MMR supports merging into text boexes with MS Word.
I hope this help you.
Regards
Anabel