Tech Tip: Creating functions available in the DataStore class
PRODUCT: 4D | VERSION: 21 | PLATFORM: Mac & Win
Published On: March 31, 2026
The documentation of Data Model Classes provides an example of creating functions available in the DataStore class through the ds object. You can read more in the DataStore class section.
This tech tip aims to provide the steps needed to implement the example code in the documentation above.
This implementation allows custom functions to be easily accessible by developers via the ds object.
This tech tip aims to provide the steps needed to implement the example code in the documentation above.
- 1. In the bottom of 4D Explorer, click on the three dots for the Explorer's options menu and select "Show all data classes"
2. ORDA classes should now be visible. Double click on DataStore and paste the code in the documentation:
| // cs.DataStore class Class extends DataStoreImplementation Function getDesc $0:="Database exposing employees and their companies" |
3. Create a new project method and call the function:
| $desc:=ds.getDesc() //"Database exposing..." |
This implementation allows custom functions to be easily accessible by developers via the ds object.