Entering Data - Fields and Buttons

From ADempiere
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.

Table of Contents{{#if: | | [[{{{2}}}]] }}{{#if: | | [[{{{3}}}]] }}{{#if: | | [[{{{4}}}]] }}{{#if: | | [[{{{5}}}]] }} | Entering Data - Fields and Buttons{{#if: Functionality| | Functionality }} ⇒

Each window that you open in ADempiere will likely provide you with the opportunity to enter data. This article describes the types of fields, buttons and controls that you will come across, the type of data that they will accept and how each of them functions. All the controls are listed below. The most common ones are String, Number, Date.

Several of the fields have helper functions, indicated by an icon/button at the right side of the field. The helper functions can be opened by clicking this icon. They may also open if the entered data is not clear or complete. The helper functions include the Calendar Tool, Calculator Tool, Search and Info windows (See the Functionality list), and others.

Unless noted below, most fields will accept and lose the focus as the <Tab> key is typed on the keyboard. When they have the focus, the icon buttons can be activated by typing the <Space> key.

Each field also controls the pop-up menu that appears when the mouse is right-clicked over the field.

Account Icon Account24.png

The Account Element control displays the details of a selected Accounting Dimension or combination. (See Accounting Dimensions for more info.) It is usually found on Accounting tabs which provide accounting information related to the parent tab.

 

Field Account.png

 

Data can be typed into the field as text. The data that is entered will be assessed as follows:

  • If the text is null, zero length or equals "%", the Account Dialog will be opened.
  • If the text does not end with a percent sign "%", one is added as the last character.
  • The software then looks for a valid combination where the alias or the combination string match the text
  • If there is a single match, the field is filled with the valid combination.
  • If there is no match or more than one match, the Account Dialog is opened.

The Account Icon (Icon Account24.png) can also be pressed to activate the Account Dialog. A combination selected in the Account Dialog will be displayed once the dialog is confirmed and closed. If the Account Dialog is canceled, the Account field will be cleared.

The pop-up menu (mouse right-click) will display the following entry:

(Software: client/src org.compiere.grid.ed.VAccount.java)

Amount Icon Calculator24.png

Amounts are numeric fields with a minimum precision of 2 decimal places and a maximum of 12. Amount fields are typically used for monetary values. See Number for more information.

Assignment Icon Assignment24.png

The Resource Assignment field provides a way to assign resources to schedule slots. If a resource assignment exists, the field will show the resource name, the date of the assignment and the number of slots used or it will display the resource assignment ID.

The Assignment field is typically found on the {{#if: Sales Order|Sales Order|SalesOrder }} Window on the {{#if: Order Line|Order Line|OrderLine }} Tab.

There is no way to enter data directly in the field. You have to use the helper functions. Clicking the Assignment helper function (Icon Assignment24.png) will do the following:

Confirming and closing the Resource Assignment Dialog will save the assignment to the Assignment field. Canceling the Resource Assignment Dialog will clear the Assignment field.

The pop-up menu (mouse right-click) will display the following entries:

For more information see:

(Software: client/src org.compiere.grid.ed.VAssignment.java)

Binary

Binary Data fields can be used to store pretty much anything that can be found in a computer's file system. The binary data is stored as a BLOB or Binary Large OBject. The Binary field appears in ADempiere as a Button. Clicking the button will open the File Chooser and allow you select a BLOB (any file) and save it to the database. The button text will show the following:

  • "-" if there is no data stored
  • "#xyz" where xyz is the size of the data in bytes
  • The name of the class object stored
  • "?" if the data is not byte data and not a class.

If a blob is already saved, clicking the button will allow you to reverse the process and save the BLOB to the file system.

ADempiere does not make direct use of Binary fields in windows and tabs but they are used by the software for Attachments, Images, Migration scripts and class instances. However, nothing prevents you from using Binary fields in any custom windows and tabs you develop.

Note.gif Note:

PostgreSQL version 9 was recently released and is not backwards compatible with earlier versions. One of the changes was in the manner that BLOBs were stored in the database. We recommend you use PostgreSQL version 8.4 or earlier until we fix this.

(Software: client/src org.compiere.grid.ed.VBinary.java)

Button

Buttons perform a command of some sort - starting a process, running a script or performing some other task.

The Button is defined as a field in the database, but data may not be stored there. Instead, the record in the Column definition includes information that determines how the Button is to function. There are a few special cases.

If the column name is:

  • Record_ID (Icon Zoom24.png), then the button performs the Zoom function, going directly to the default window and tab for that record. This is useful in situations where the current window is reporting on the status of another record, such as in the Workflow windows. The Record_ID value is pulled from the context. There are a few special cases of this as well:
    • If the current tab does not have a Record_ID and the key column name is "AD_Language", the Record_ID is set to the AD_Language_ID value.
    • If the current tab does not have a Record_ID and the process associated with the Button is "Un-Do Changes" or "Re-Do Changes", then the Record_ID is set to the AD_Changelog_ID.
  • PaymentRule (Icon Payment24.png), clicking the Button will pop-up the Payment Dialog. If the invoice is not completed, the Payment Dialog will be limited to payments types. If the invoice is completed, the Payment Dialog will allow you to complete a full payment. This is very useful in POS applications when using POS Orders or Credit Orders with Invoice Indirect and immediate payment. The button text will reflect the payment method chosen.
  • DocAction (Icon Process24.png), clicking the Button will open the Document Action Dialog. This dialog allows you to set the status (Drafted, In Progress, Completed, Closed, etc...) of the document. Changing the status will trigger the associated workflow process, if any, the document processing engine and the accounting engine. The button text will reflect the next document action in the normal workflow.
  • CreateFrom (Copy24.png) and there is no process associated with the Button, clicking the Button will open a Create From Dialog where lines from an associated document can be selected and used to create lines in the current document. See the Create From Dialog page for more information.
  • Posted (Icon InfoAccount24.png) and the User's role has Show Accounting in the {{#if: |{{{2}}}|Role }} Window, then if the document is processed and posted, clicking the button will open the Account Info dialog with the Select Document set to the current document. The accounting consequences or financial accounting details of the posting will be shown. Note that the Re-post button will be enabled. If the document has not been posted yet, clicking the button will open a dialog that asks "Post Immediate?". Confirming this dialog will cause the record to be posted. Typically, the Posted button is hidden and will only appear once the document has been completed, closed, reversed or voided. The label of the button will reflect the status of the posting.

If none of the above apply, the software checks to see if a process is defined for the Button and attempts to run that process or invoke a custom form.

Software:

  • client/src
    • org.compiere.apps.APanel.java
    • org.compiere.grid.ed.VButton.java

Color

A Color element provides a way to set a color in the database. The Color control appears as a button. Clicking the button will open a color dialog where the color properties can be set. Colors can be selected using the java swing JColorChooser tool.

Note.gif Note:

The only default use of the Color elements is in workbench and desktop settings. Workbench and desktops are beta features and are not used in the application - at least not in a way that is easily visible. The color controls are not fully functional. Feel free to include Color elements in customizations though.

Software:

  • base/src
    • org.compiere.swing.ColorEditor.java
  • client/src
    • org.compiere.grid.ed.VColor.java

Costs+Prices Icon Calculator24.png

Costs + Prices are numeric fields with a minimum precision of 2 decimal places and a maximum of 12. Costs + Prices fields are typically used for monetary values. See Number for more information.

Date Icon Calendar24.png

The Date control maintains data as a time stamp in a format consistent with the locale and language of the user's system. The format definitions follow the Java class SimpleDateFormat. If no default format is found, the JDBC standard will be used "yyyy-MM-dd". Local formats will be converted to contain at least "dd" and "MM" numbers in the format code. Year codes will be increased to at least four digits.

The Date control operates like a text field where data can be input by keyboard entry. The digit being entered is enclosed in blue square brackets and format characters are ignored - just type the numbers.

Alternatively, the Calendar Tool can be opened and used to enter a date.

The pop-up menu displays the following options:

Software:

  • base/src
    • org.compiere.util.DisplayType.java
  • client/src
    • org.compiere.grid.ed.MDocDate.java
    • org.compiere.grid.ed.VDate.java

Date+Time Icon Calendar24.png

Date with time control is similar to the Date control but includes the time component with the full timestamp format of yyyy-MM-dd HH:mm:ss. The text field can't be edited directly so you have to click the button to open the Calendar Tool to enter the values.

See Date above for more information.

FileName Icon Open24.png

The FileName control is intended to hold a file name that can be found in the local default directories. Clicking the button will open the File Chooser dialog where you can select the file of interest. You can also enter the file name in the text field directly.


Software:

  • client/src
    • org.compiere.grid.ed.VFile.java

FilePath Icon Open24.png

Local File Path control is similar to the FileName control but is restricted to a directory path only - no file names. Clicking the button will open the File Chooser dialog where you can select the directory of interest. You can also enter the file path in the text field directly.

Software:

  • client/src
    • org.compiere.grid.ed.VFile.java

ID Icon Reset24.png

The ID control identifies a specific record in a table using the *_ID field. The control uses a lookup/search to identify the record. What appears in the ID control is determined by the Identifier field selection in the {{#if: |{{{3}}}|Column }} Tab of the {{#if: Table And Column|Table And Column|TableandColumn }} Window where the *_ID field is the key. For example, the Value can be Identifier 1 and Name Identifier 2, appearing as Value_Name. References (see the {{#if: Reference|Reference|Reference }} Window) can also be used to control what is displayed in particular windows/fields.

For most ID columns, the ID control will present a combo box with a list of available values. As you type text in the control, the combo box will drop down and the most likely choice will be selected. Typing <Enter> of selecting the entry with a mouse click will save the data in the field.

If there is an Info window associated with the target table, the icon in the button will change to (Icon Reset24.png). Text entered in the field will be compared with common columns in the table to find a match. If no match is found, more than one match is found or the button is clicked, the associated Info window will appear. Selecting and confirming a record in the info window will cause the ID field to be filled with the associated ID. Canceling the Info window will clear the ID field. Closing the Info window will have no effect. See Functionality for a list that includes the info windows.

The following ID fields behave slightly differently:

  • Product ID (Icon InfoProduct24.png): text typed into the field will be matched with the Name, Value or Search Key and SKU. If a single match is found, the ID field will be filled with that Product ID. If more than one match is found, no matches are found or the text is a wild card "%", then the Product Info dialog will be opened. The ID field will be filled by the selected and confirmed value in the Product Info dialog. Canceling the Product Info dialog will clear the ID field. See Product Info for more information.
The pop-up menu in a Product ID field will display the following entries:
  • Business Partner ID (Icon BPartner24.png): text typed into the field will be matched with the Name, Value or Search Key. The search will be limited to customers or vendors depending on the nature of the transaction (IsSOTrx?) of window on which the ID is found. If a single match is found, the ID field will be filled with that Business Partner ID. If more than one match is found, no matches are found or the text is a wild card "%", then the Business Partner Info dialog will be opened. The ID field will be filled by the selected and confirmed value in the Business Partner Info dialog. Canceling the Business Partner Info dialog will clear the ID field. See Business Partner Info for more information.
The pop-up menu in a Business Partner ID field will display the following entries:

See Search for more information.

Software:

  • client/src
    • org.compiere.grid.ed.VLookup.java

Image

Image fields can be used to display images that are stored in the database as binary data or linked to a URL. When the Image field is initially displayed, it will appear as a button with the text "-" displayed. Clicking on this button will open an Image dialog which appears as a small window as shown below.

 

ImageDialog.png

 

The dialog has three buttons: the standard Cancel and Confirm, and a small button "-" labeled Select File. Clicking this last button will open a file chooser where you can select an image from the file system. When the image is selected and opened, it will appear in the Image dialog and the button will hold the file name. Clicking Confirm will save the image to the database. Clicking Cancel will delete any image saved in the database and close the window. Closing the window will have no effect.

Once an image is saved in the database, it will appear in the window/tab in place of the button. The image will be sized to fit within a box defined by the column width set for that column in that tab.

Clicking the image again will re-open the Image dialog with the image loaded. To delete the image, click the Cancel button. Clicking the button with the file path/name will open the file chooser where you can select another image. Click Confirm to save that image to the database.

Software:

  • client/src
    • org.compiere.grid.ed.VImage.java
    • org.compiere.grid.ed.VImageDialog.java


Integer

The Integer field is a numeric field with no fractional part and a maximum of 10 digits. See Number for more information.

List

A List appears as a combo box pre-filled with values that you can select. As you type in the box, the combo box will expand to show the best choice based on what you have typed. Type <Enter> to select it, or use the mouse to select the list entry. To set the List field to null, select the blank entry in the list.

See also

Location (Address) Icon Location24.png

The Location control provides a way to attach an address to a record. The Location control does not accept text directly but the button can receive the focus and can be activated from the keyboard by typing <Space>. You can also click on the button (Icon Location24.png). This will open the Location Dialog where you can specify the full address.

 

LocationAddress.gif

 

When the Location Dialog is closed, the Location control will display a summary of the address information entered.

There is no way to fully clear the Location control once data has been entered. The pop-up menu item Delete will delete the record by clearing the entry and will open the Location Dialog. Canceling the dialog will only clear some of the information, leaving defaults in place.

The pop-up menu (right-click) provides options to:

Locator (WH) Icon Locator24.png

The Warehouse Locator field displays the key field of a warehouse location. Both the field and the button will accept the focus.

Text typed into the Locator field will be compared to valid locations already defined. If the window already references a warehouse or a product, the locator entries will be limited to valid values for these references. If a single match is found, it will be used. If the text consists of a single percent symbol (wildcard %), no results are returned or more than one result is found, then the Locator Dialog is opened as shown below.

 

LocatorDialog.png

 

The Locator Dialog can be used to select an existing Locator reference or define a new one. If a new entry is defined, the Key value will be used to identify it in the Locator field.

The pop-up menu (right-click) provides options to:

The software that controls this field is found in:

  • client/src
    • org.compiere.grid.ed.VLocator.java
    • org.compiere.grid.ed.VLocatorDialog.java

Memo

The Memo field will accept character strings up to 2000 characters. It is similar to the Text and String fields with the exception that it uses a text area with 80 columns width and a height of 50 rows and can't be encrypted. If the text in the field exceeds the size of the text area on the screen, scroll bars will appear.

The memo field will accept the focus but <Tab> characters will be entered as text. Use <Ctrl><Tab> or <Ctrl><Shift><Tab> to change the focus.

Typing <Escape> will reset the text to its previous value.

The pop-up menu includes a single entry. If the Column name is "Script", the pop-up will point to the Script editor. Otherwise, it will point to the text Editor.

The software that controls this field is found in:

  • client/src
    • org.compiere.grid.ed.VMemo.java

Number Icon Calculator24.png

Number fields provide a way to enter and display numeric values. There are several types:

The default number field has a maximum of 28 digits in the integer part and 12 digits in the fractional part. The default presentation is as a float number with one digit after the decimal. The number of digits in the presentation varies with the type of field.

All the numeric fields use the Calculator Tool as the helper function. To access the Calculator, click on the Calculator icon (Icon Calculator24.png).

The presentation of the field for all the numeric fields can be overridden by defining a number format in the {{#if: |{{{3}}}|Column }} Tab of the {{#if: Table and Column|Table and Column|TableandColumn }} Window.

The pop-up menu displays the following options:

(Software: client/src org.compiere.grid.ed.VNumber.java)

Printer Name

The Printer Name field is a String field. See String for more information.

Product Attribute Icon PAttribute24.png

The Product Attribute field or Product Attribute Instance is a field dedicated to selecting or displaying a specific instance of Product Attributes. It appears as a text field with an icon/button (Icon PAttribute24.png). The text field will not accept the focus but the button will. You can double click the field or click the button to activate the helper function and open the Product Attribute Dialog.

 

PAttributeDialog.png

 

The dialog displays the details of the product attribute instance. There are two controls:

  • New Record (or Edit Record) - New is used when adding items to inventory. Edit is used to modify attributes on an order.
  • Select an Existing Record - Used to select an existing attribute instance from inventory.

The other fields that appear depend entirely on how the Product Attributes are defined.

The pop-up menu for the field will have entries to

See Product Attributes for more information.

The software that controls this field is found in:

  • client/src
    • org.compiere.grid.ed.PAttribute.java
    • org.compiere.grid.ed.PAttributeDialog.java

Quantity Icon Calculator24.png

The Quantity field is a numeric field with a maximum of 12 digits in the fractional part and 28 digits in the integer part. See Number for more information.

RowID

The Row ID Data Type is currently not active in the database.

Search Icon Reset24.png

A Search Field is used to look up data. The Search field appears as a combo box with a list of available values. The text field will accept the focus but the button can only be operated by the mouse.

As you type text in the control, the combo box will drop down and the most likely choice will be selected. Typing <Enter> of selecting the entry with a mouse click will save the data in the field.

Text entered in the field will be compared with common columns in the table to find a match. If no match is found, more than one match is found or the button is clicked, the associated Info window will appear. Selecting and confirming a record in the info window will cause the ID field to be filled with the associated ID. Canceling the Info window will clear the ID field. Closing the Info window will have no effect.

There are a few special cases:

  • If the column name ends in "_ID", it is treated as an ID Field. There are special cases for these as well. See the ID field for more info.
  • If there is an Info window associated with the column name, that info window will be used to perform the search. See Functionality for a list that includes the info windows.
  • If none of the above, a generic Lookup form will be used.

The pop-up menu (mouse right-click) will have the following options:

See also

Software:

  • client/src
    • org.compiere.grid.ed.VLookup.java

String

String fields are one of the most common types of fields in the database. A String is simply a sequence of up to 2000 characters but it is intended for shorter amounts of information.

The String field appears as a simple text field. It can accept and lose the focus with the <Tab> key. The <Escape> key will reset the value. It can be encrypted, like a password, if necessary and can have an "auto complete" feature enabled. It can also have special formatting applied.

The pop-up menu (right-click) provides options to:

The software that controls this field is found in:

  • client/src
    • org.compiere.grid.ed.VString.java

Table

The Table data field uses a reference to look up data in a table. It behaves like the ID and Search fields. See Search for more information.

Table Direct

The Table Direct data field uses a default reference to look up data in a table. It works best for tables that have defined Info windows. It behaves like the ID and Search fields. See Search for more information.

Text

The Text data field is used for character strings up to 2000 characters long. It appears as a text area. It will be 2 rows high if the field length is less than 300 and three rows high otherwise. It is very similar to the Memo field.

The pop-up menu includes the following options:

  • Icon Edit24.png Script Editor - if the column name is "Script" or ends with "_Script". This will open the Script Editor Tool
  • Icon Edit24.png Editor - if not a Script. This will open the Text Editor Tool

See also

The software that controls this field is found in

  • client/src
    • org.compiere.grid.ed.VText.java


Text Long

The Text (Long) field is intended for Text > 2000 characters in length. It is interpreted and presented as HTML text.

The pop-up control includes the following items:

See also:

The software that controls this field is found in

  • client/src
    • org.compiere.grid.ed.VTextLong.java

Time Icon Calendar24.png

The Time control is similar to the Date control but only shows the time component in the local format similar to h:mm:ss z or HH:mm:ss z. The text field can't be edited directly so you have to click the button to open the Calendar Tool to enter the values.

See Date above for more information.

URL Icon Online24.png

The URL behaves like a Text field with an added helper function (Icon Online24.png). When you click the button, the software will attempt to open the text as a URL using the default browser on the system.

The pop-up menu (right-click) provides options to access:

Yes-No

The Yes-No control appears as a Check Box.

Yes-no.png

Checking the box is equivalent to Yes. Deselecting the box is equivalent to No. The data is saved in the database as the corresponding letter "Y" or "N".

The pop-up menu (right-click) provides options to access: