Form Information Section
First, the title name of the form that will appear during the application is changed. To do this, double-clicking on the form will update the Caption field from the Property Viewer Panel that opens on the right side of the screen to "Expense Declaration Form".
Because the form will consist of different sections (such as Form Information, Requester Information, Expense Detail Information, etc.), the section information can be specified using the Label object to avoid looking complicated. Thus, whichever object belongs to which section is found under the relevant section heading.
The form information section will contain the fields Document Number and Document Date. The DocumentMetadata object is used to automatically populate both of these pieces of information for the form by the system when the form is created.
For the Document Number field, the DocumentMetadata object is added to the form, and the Id option is selected from the Select Metadata Type field in its properties. In order to assign the Document Number field a value in the desired format, double-click an empty space on the Form and click the ellipsis next to the Identity Format property from the form properties that open on the right.
You can select Choose a templates here to select an existing format that has already been created, or the Define new one and use attribute can be selected to create a new format.
The Document number field of the Expense Declaration Form can be formatted as MB-{%year%}-{{cccc}}. The year field in this format identifies the current year, while cccc identifies a 4-digit counter.
When the document is first created, the counter value is assigned the value specified in the Counter Start Value field, which is given as "1". Each time the document is created, the counter will increment to the Counter Increment Value, also defined as "1".
For the Document Date field, the DocumentMetadata object is added to the form, and the Select Metadata Type field in its properties automatically selects the CreateDate option, which gives the creation date of the document.
INFO
A Form can have up to 2 DocumentMetadata objects. When this object is added 2 times, this property on the recently added object becomes automatically selected because there are only two fields in the Metadata Type options, one Id and the other createDate, and no change to these properties is allowed until one of the objects is removed.