Wednesday, July 17, 2013

display and edit methods

display():
The display method modifier is used to indicate that a method’s return value is to be displayed on a form or a report. if you want to edit the value use a edit method. the display method using Table methods,Form methods, Form DataSource methods,Report, Report Design methods.
Write your display methods on a table. You can use the same code in several forms or reports. 
display methods are called each time the form is redrawn. They should not contain complex and  time consuming calculations.
To create a display method, place the display keyword immediately in front of the method’s return type.
Ex: 
display AddressStatename stateName()
{
    return AddressState::find(this.CountryRegionId, this.State).Name;
}
display methods must have a return type. The return value is typically a calculated value (for example, a sum).
There should no parameters in a display method unless it is on a form data source where you must include the data source as a parameter. 
For example:
display boolean displayOperations(AssetGroup _assetGroup)
Note: You must use display on a form data source method when the return value is to be shown on a grid control.
AOT>Forms>AssetGroup.
edit():
The edit method modifier is used to indicate that a method’s return value is to be displayed on a form, and users can edit that value. If you don't want users to edit the value, use a display method.
Use the edit method modifier on Table methods, Form methods, Form data source methods.
Write your edit methods on a table. You can use the same code in several forms.
edit methods are called each time the form is redrawn. They should not contain complex and  time consuming calculations.
Create an edit method on a form or table.
  1. Place the edit keyword immediately in front of the method’s return type.
  2. Create a Boolean parameter called Set. It is used to determine whether the user has entered anything into the control.
  3. create a second parameter to hold the values that the user has entered into the control.
  4. If the edit method is on a form data source, create a third parameter for the data source. Place this parameter after the Set parameter.
    Ex: AOT>Table>CustTable>Methods>edit ContactPersonName

    edit ContactPersonName editContactPersonName(boolean _set, ContactPersonName _name)
    {
        return this.CustVendTable::editContactPersonName(_set, _name);
    }

    Form Level: AOT>Forms>BOMCalcSum>Methods>editCostSales

No comments:

Post a Comment

Enable/Disable form control based on multiple rows select

 class PurchTableFormEventHandler {      [FormDataSourceEventHandler(formDataSourceStr(PurchTable, PurchTable), FormDataSourceEventType::Act...