I'm trying to create a simple formula in Word format Report Layout. I have an XML map and I can create the formula in text =AmountLine_Line/Quantity_Line, upload the template to Business Central and it displays as written with the proper server data displayed. As soon as I wrap it in formula brackets it errors out. Undefined Bookmark. Any suggestions?
This issue typically occurs when Word formulas in the layout reference a bookmark or XML part that’s either missing or not mapped correctly. In Word layout reports for Business Central, formulas like =AmountLine_Line/Quantity_Line must be wrapped inside a Word content control linked to the XML mapping—not just typed with = or brackets.
✅ Here's what you can try:
Use Insert → Quick Parts → Field or Developer → Plain Text Content Control and bind it properly to the XML element.
Ensure both AmountLine_Line and Quantity_Line are correctly mapped in the Custom XML Part.
Avoid manually writing formulas unless you're using Word formula fields (e.g., =SUM(...)) within Word tables.
Unfortunately, complex calculations are best done in AL or in the report dataset before passing to Word.
If you need more logic, consider preparing a calculated field in AL and sending that to the layout instead.
✅ Mark this answer as verified if it helps you.
Was this reply helpful?YesNo
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.