Sunday, June 5, 2011

Use of Data Source Methods in axapta

Use of Data Source Methods in axapta


Adding a new record from a form will call the following sequence of data source methods:
create() ► initValue() ► refresh() ► active() ► refresh()
1. The method create() is called when pressing ctrl+n to add a new record.
2. The data source initValue() is called by create(). You should initialize fields which must have a specific value in initValue(). The table method initValue() is called by super() in the data source initValue(). If the
initialized values are not form specific, you should use the corresponding table method.
3. After initialization refresh() is called, and when entering a record active() is called. Refresh is called again by active().
When saving a record the following methods are called:
validateWrite() ► write() ► refresh()
1. ValidateWrite() will call the table method validateWrite(). Again, always
use the corresponding table methods if possible.
2. The data source method write() will call either insert() or update() from the table, depending on, whether the record is already created or not. Checks to be made should be done before this point. If you have conditions to be fulfilled these should be done at validateWrite().
3. Refresh() is called to update the form controls.
Deleting a record has a similar flow as insert and delete:
validateDelete() ► delete() ► active()
1. ValidateDelete() will call the corresponding table method. Condition checks for deletion should be done at this point, either from the data source or from the table.
2. The form data source delete() calls the table method delete().
3. Active() is called as the cursor will jump to another record after the current record is deleted.

1 comment:

Blog's Followers

Google+ Followers

Awesome Inc. template. Powered by Blogger.

Total Pageviews

Status of Website

View My Stats

Categories

.Net business connector (2) A Brief History of Axapta (1) active directory (2) aif (2) AOS (9) args (14) Array (2) ax (23) AX 2009 Development Introduction (3) ax 2009 financial certification (4) AX Administration (27) AX Certifications (3) ax forms (2) Ax Functional (53) ax future (4) ax reports (4) Ax Sound (1) Ax Validation (4) axapta (24) Axapta Areas (2) Axapta at Runtime (15) axapta classes (4) Axapta Companies (1) axapta financial (4) Axapta helpful jobs (1) axapta query (7) Axapta theory (47) Axapta Tips and trick (37) Axapta Websites (18) Axapta x++ coding examples (19) Best practices (2) Business Connector (4) Calling Sql Stored procedure through axapta code (1) Common errors (10) configuring IIS (2) Connecting to External Database From Axapta by x++ code (1) containers (4) CSV (3) Data dictionary (2) Date solutions (1) Dialog (8) DictTable (1) Dimensions (5) dynamicx axapta certification (4) ENTERPRISE PORTAL (23) Enterprise portal site (1) EP Administration (10) EP problems (1) ERP Comparisions (1) exam dumps (1) Excel tips and trick (2) Exception (3) execute query (3) fetch (11) finance (4) financial paper (4) getfromdialog (4) Hotfix/Rollup (1) IIS (4) Image handling in Ax (5) Import and Export Utility (2) Indexing (1) KPI (2) Label Files (2) Lookup Codes (1) MB6-282 (1) MB6-818 (4) MB6-819 (3) MB6-820 (3) MB6-821 (1) MB6-869 (1) MD6-817 (4) menuitems (8) Microsoft MB6-818: AX 2009 Financials paper (4) Number Sequence Magics in axapta (9) OLAP (10) Pack and Unpack (1) Play with Gridview (1) POS (1) Production Module (3) Programatically uploading image to document handling in axapta (1) query range (7) querybuilddatasource (15) querybuildrange (4) QueryRun (2) RAID (1) Read data from an AX table using BusinessConnector (1) read data from datasource control in axapta (1) refresh (3) Role center in EP (1) Runtime form controls in axapta (1) sales order in other currency (1) Sharepoint (9) show data source information using axapta (1) shutdown (1) Simple runtime lookup code in axapta x++ language of Microsoft (1) SSRS (3) String Manipulation (18) Syntax (2) sys (1) Tables (3) Tables which included in purchase order posting in axapta (1) Take care about Dimension customization (1) Target date not found in work calendar error (1) TDS settlement tables and usable fields in axapta (1) The most commonly used classes in the query object model (1) The number of characters to select from position onwards (1) The number to convert to a text string using axapta x++ (1) The string of characters to be repeated (1) The text string to search (1) Training institutes (1) Type conversions (10) Version Control (1) Views (2) workflow (4) XML (2)
Active Search Results Technology Blogs