Skip to main content

Expense Detail Form Design

The main fields of this form, which the user will be directed to add a row to the Expense Information table in the Expense Declaration Form, are as follows;

Expense Type :A field that indicates the type of charges incurred and is selected from the data recorded in the table on the parametric form
Voucher Date :The date on which the receipt for the expense was issued
Number of People:Field that indicates how many people have requested expenses
Expense Amount :This is the field where the amount for the expense entered is entered
Description :This is the area where the detailed description of the cost can be entered
Documents :This is the area where expense-related documents (receipt, invoice photo, etc.) can be attached

To create the form, first select CSP App Form by right-clicking on the Forms folder in the solution explorer and enter a File Name for the form as "ChargeDetailForm" from the window that opens. Detail Form Creation

For the Charge Type field, the user is expected to be able to select from specific types of charges, and a ComboBox object is added to the form to make this selection. charge type combobox

The fact that the cost types can be added and edited by specific users instead of being determined during development will allow the application to be more dynamic. For this, the data that can be selected in this field will be taken from another parametric form.

[**Expense-types-parametric-form-design.md) is designed for this process.

After the Design of the Parametric Form for Charge Types is performed, this query is selected in the DataSource property of the ComboBox object's properties so that data from the FetchChargeTypes query can be shown in the ComboBox field in the Expense Detail Form.

After the query is selected, new fields open under the DataSource property as Value Expression and Display Expression. The Id column is selected in the Value Expression field for the value that is desired to be kept in the background, and the CostType column is selected in the Display Expression field for the values that are desired to be visible to the user. Expense Type ComboBox Value-Display

The DateTimePicker object for the Voucher Date field is added to the form. In the object properties, under the Behavior tab, under the Format field, YYYY-MM-DD HH:mm is selected to include day-month-year-hour. When the Show Time option is activated, the time selection field is also activated on the object.

voucher date

The NumberBox object is added to the form for the field where the number of contacts can be entered. The Min field can be changed to 1 for the minimum value that can be valid, and the maximum value can be set to 10. Because the number of contacts must be an integer, the precision field after the comma for decimal numbers must be left as 0. number of people

A NumberBox object is also added back to the form for the Expense Amount field. Since it is not possible for the cost to fall to negative values, the Min value should be given as 1 for the minimum value that can be entered. The Use Thousand Separator feature is activated to open the thousands separator. By clicking the up and down arrows located right next to the field or by using the arrow keys, the value can be increased or decreased by the amount entered in the Step property. COST AMOUNT

A TextArea object is added to the form for the Description field, where the user can type details about the expense incurred. The MaxLength property can be set to a value of 250 for the character limit of the text that can be input from object properties. The Show Character Counter feature is enabled to show the number of characters remaining that the user can enter. expense detail description

The DocumentMetaData object is added to the form for the Documents field where documents (receipt, invoice photo, etc.) of the expense incurred can be added. After the object is added to the form, the necessary features are enabled by default so that the document can be added, deleted, and viewed. When an image-type file is added to an object, the Show Content For Image Files feature must be enabled if it is desired to show the file as a thumbnail instead of the extension icon.

Show File Extension Icon must be enabled to use this feature.

If the document attached to the object is to be saved in Document Management, a file path must be defined in the Save Path (DM) feature.

expense detail document

Selecting "Other" in the Charge Type field can make the Description field a mandatory field for the user. To do this, OnBeforeSave** is selected from the Events of the Expense Detail Form.

If the value value of the item selected from the object "ComboBox1" corresponding to the Expense Type field is 4, and the contents of the object "TextArea1" corresponding to the Description field are empty, the user is warned and the form is prevented from being saved. other type of charge

INFO

The text field of the TextArea1 object defaults to "undefined" when the form is created. After it is filled in and deleted, it has a blank ("") value. The value value of ComboBox1 corresponds to the Id value in the data source, and the Id value of the "Other" option of the charge types in the Charge Detail Table is 4.

Now that all the fields have been created, the Expense Detail Form is ready to be associated with the Expense Detail Table in the Expense Declaration Form.