Object Metadata
From AgileApps Support Wiki
Revision as of 00:58, 15 February 2011 by imported>Aeric
- Learn more: Java API:Customize
Object metadata is the data that describes an object--it's name, for example, and it's ID.
CustomObjectMetaDataBean
- Description
- Retrieves metadata from Custom Objects; not available for System Objects
- Syntax
CustomObjectMetaDataBean Functions.getObjectMetaData(String objectName) /* where objectName is the Custom Object name */
- Example
Functions.debug("Initiate Object Meta Data Retrieval"); CustomObjectMetaDataBean comdb = Functions.getObjectMetaData(String objectName) Functions.debug("Object Display Title : "+ comdb.getDisplayTitle());
Map getObjectMetaDataMap
- Description
- Returns a map of all visible Custom Objects with object_id as the key and the corresponding object's metadata as a value
- Syntax
Map Functions.getObjectMetaDataMap()
- Example
Functions.debug("Initiate Object Meta Data Retrieval"); Map comdbCollection = Functions.getObjectMetaDataMap() for(Map.Entry e:comdbCollection.entrySet()) { CustomObjectMetaDataBean bean = e.getValue(); Functions.debug("Object ID :" + e.getKey()); Functions.debug(" Object Display Title:" + bean.getDisplayTitle()); }
addObjectMetaData
- Description
- Adds an object and returns the id of the newly created object
- Syntax
String Functions.addObjectMetaData(CustomObjectMetaDataBean comdb)
- Considerations
-
- Object names:
- Must start with an alphabetic character.
- May contain only alphanumeric (a-z A-Z 0-9) and underscores (_).
- May not contain spaces or other characters.
- Must be 32 characters or less.
- Example
Functions.debug("Initiate Add object"); CustomObjectMetaDataBean omdb = new CustomObjectMetaDataBean (); omdb.setDisplayTitle("JAVA API OBJECT"); omdb.setSingluarDisplayTitle("JAVA API OBJECT"); omdb.setBuiltIn(false); omdb.setNameColumn("name"); omdb.setWebTab(false); omdb.setObjectName("API_OBJ"); String new_object_id = Functions.addObjectMetaData(omdb); Functions.debug("Added an object:"+new_object_id);
updateObjectMetaData
- Description
- Updates an object and returns the id of the updated object
- Syntax
String Functions.updateObjectMetaData(CustomObjectMetaDataBean comdb)
- Example
CustomObjectMetaDataBean omdb = Functions.getObjectMetaData("API_OBJ"); omdb.setDisplayTitle("JAPIOBJ"); Functions.updateObjectMetaData(omdb);
deleteObjectMetaData
- Description
- Deletes an object
- Syntax
Functions.deleteObjectMetaData(CustomObjectMetaDataBean comdb)
- Example
Functions.deleteObjectMetaData( Functions.getObjectMetaData("API_OBJ"));