{{tag>Function Function_List Reports_And_Documentation}}
====== SUB_DOCUMENT ======
===== Description =====
Includes a subdocument inside a master document. The source of data for the sub-document is specified as the first parameter of the function. The sub-document will be included for each instance of the business object in the data source.
**note**
This function can only be used inside tags in MS Word documents!
===== Syntax =====
''SUB_DOCUMENT (list, template)''
Cannot be used in the condition of a [[:ref:a_f:a:find|FIND]] action.
===== Parameters =====
- Identifier of the list or a string identifying the query (either Rule Language string or the name of the existing query). List members of business objects found by a query serve as the data source for the sub-document
- Name of the document template identifying the sub-document.
===== Returns =====
**Nothing**: inserts one copy of the sub-document template per business object in the list into the master document; works only inside tags in MS Word document templates
===== Example =====
<>
===== Related =====
[[ref:a_f:f:af:list_table|LIST_TABLE]], [[ref:a_f:f:af:list_line|LIST_LINE]], [[ref:a_f:f:af:page_number|PAGE_NUMBER]], [[ref:a_f:f:af:number_of_pages|NUMBER_OF_PAGES]]