display method, edit method, cach display ,security(备查)

Display method:
The display method of repair modifiers, as its return value will be a value can not be modified is displayed on the form and report. If you want this value can be edited, it is to edit method.
<1> Method of writing position Display:
Display modifiers can be used in the following methods:
(1) Method in Table
The method in (2) Form
(3) Method in Form data source
(4) Method in Report
(5) Method Report design under
display method in a Table can be reused in multiple form and report. Display method will be executed when the form is redrawn.
Do not write on the display method complex and time-consuming technical or operational.
Hidden display method on the tab page will not be called. And, display method may be cach up.
<2> Create display method
The format is as follows:
The display modifier in front of the return value, and the display method must have a return value. Such as: display Amount amount ()
When the display methods are written in the form data source, data source must be passed as a parameter to the display. When the return value display is displayed on a grid control form, it is necessary to write the display method at the data source. as follows:
display InventQty accumulated(InventBudgetInvent Budget)
In addition, display method does not require parameters.
<3> The method of the display
When using the display as a method, data type and display type control method return values ​​must match the form control and report control.
(1) using the display on the form control
a) providing a control of the DataSource dataSource attribute that do display method. If this attribute is empty, the default method is defined in the display form.
DataMethod property b) provided for the method name display control method.
While the control may be provided and ArrayIndex ExtendedDataType properties. If ExtendedDataType is set, the control will inherit the EDT format, help information, and so on.
If the display method returns an array, the array ArrayIndex set to 0 in all elements are displayed on the control. If the ArrayIndex a non-zero positive number n, only the n-th element of the array is shown.
(2) Use the display on report control
Table property a) is provided for the control method table display belongs. If the property is empty, the default display method is defined in the report.
DataMethod property b) provided for the method name display control method.
two. Caching display method
When the display method of calculation is done on AOS, or recording is transferred from a server to a client, the performance can be improved by the display method of cach.
When the data is retrieved from back-end database to the data display method will be assigned when the form data call reread methods source, these data will be refreshed.
Cach up a display method will need the following steps:
1) is positioned to form on the display using the method of
2) Init method Override data source of the display method where, after the init method of super () call FormDataSource.cacheAddMethod method. The first argument cacheAddMethod method is to display methods are cach of the method name, the second parameter (the default is true) identifies a record whether the display method update is written to the database.
Three. Edit method
Edit modifier being modified method, the return value may be displayed on the form, while the user can edit the value.
<1> Method of writing position edit:
a) Method in Table
b) method in Form
c) method in Form data source
Table edit the method can be reused at a plurality of form.
When the form is redrawn in the edit method will call, do not write complex and time-consuming operation in the edit process.
Hidden edit method on the tab page will not be called.
<2> Create edit method
a) When creating the edit method in table, the following format:
edit FreeTxt txtDefault(boolean Set, FreeTxt Txt)
The edit written in front of the return value, the first parameter is a boolean indicating whether to add the user input or control value, the second parameter is used to store a value entered by the user, the data type of the parameter We must be consistent with the data type of control.
b) When the method of creating edit in form, the following format:
edit Amount settle(boolean set, CustTrans _CustTrans, Amount U)
The first parameter is a boolean indicating whether to add the user input or control value, the second parameter is the data source where the edit method, the third parameter is used to store a value entered by the user or editor, data type of the parameter to be consistent with the data type of control.
Edit method must have a return value.
<3> edit method using:
When using the edit as a method, data types and edit the type of control method return values ​​must match the form control and report control.
(1) used in the edit form control
c) providing a control DataSource dataSource attribute do the methods for the edit. If this attribute is empty, the default method is defined in the edit form.
Method d) is provided for the control of the edit method DataMethod attribute name.
While the control may be provided and ArrayIndex ExtendedDataType properties. If ExtendedDataType is set, the control will inherit the EDT format, help information, and so on.
If this method returns an array edit, the ArrayIndex set to 0 for all elements of the array is displayed on the control. If the ArrayIndex a non-zero positive number n, only the n-th element of the array is shown.
You can refer to: http: //msdn.microsoft.com/en-us/library/aa637541 (AX.10) .aspx
IV. Confidentiality of data
The kernel will automatically perform Record level security checks, but then bypasses Record level security check when display and edit methods, and in the display and edit methods can not access what data within the authority, if these data are displayed directly, it lose the confidentiality of data. Therefore, when using the display and edit methods, you need to show the security check (if necessary).

Guess you like

Origin www.cnblogs.com/xtwkh1973/p/10990297.html