Difference between revisions of "Java API Cheatsheet"

From AgileApps Support Wiki
imported>Aeric
imported>Aeric
Line 27: Line 27:


|-
|-
|<tt>[[Java_API:Record_Handling#searchRecords|searchRecords]](String objectName, String fields, String criteria [, Parameters params])</tt>||Search and retrieve the records for an object. <tt>fields</tt> is a comma-separated list of fields to fetch. <tt>criteria</tt> is a [[Filter Expressions in JAVA APIs|Filter Expression]] || [[Result Class|Result object]]|| [[Java_API:Record_Handling|Record Handling]]
|<tt>[[Java_API:Record_Handling#searchRecords|searchRecords]](String objectName, String fields, String criteria [, Parameters params])</tt>||Search and retrieve the records for an object. <tt>fields</tt> is a comma-separated list of fields to fetch. <tt>criteria</tt> is a [[JAVA API:Filter Expressions in JAVA APIs|Filter Expression]] || [[Result Class|Result object]]|| [[Java_API:Record_Handling|Record Handling]]


|-
|-
|<tt>[[Java_API:Record_Handling#searchRecords|searchRecords]](String objectName, String fields, String criteria, String sortBy, String sortOrder, String sortBy2, String sortOrder2, int offset, int numberOfRows [, Parameters params])</tt>||Search and retrieve records for an object. <tt>fields</tt> is a comma-separated list of fields to fetch. <tt>criteria</tt> is a [[Filter Expressions in JAVA APIs|Filter Expression]] || [[Result Class|Result object]]|| [[Java_API:Record_Handling|Record Handling]]
|<tt>[[Java_API:Record_Handling#searchRecords|searchRecords]](String objectName, String fields, String criteria, String sortBy, String sortOrder, String sortBy2, String sortOrder2, int offset, int numberOfRows [, Parameters params])</tt>||Search and retrieve records for an object. <tt>fields</tt> is a comma-separated list of fields to fetch. <tt>criteria</tt> is a [[JAVA API:Filter Expressions in JAVA APIs|Filter Expression]] || [[Result Class|Result object]]|| [[Java_API:Record_Handling|Record Handling]]


|-  
|-  
Line 42: Line 42:


|-
|-
|<tt>[[Java_API:Composite_Objects#searchRecords|searchRecords]](String compositeObject, String fields, String criteria [, Parameters params])</tt>||Search and retrieve [[Composite Object]] records. <tt>fields</tt> is a comma-separated list of fields to fetch. <tt>criteria</tt> is a [[Filter Expressions in JAVA APIs|Filter Expression]] || [[Result Class|Result object]]|| [[Java_API:Composite_Objects|Composite Objects]]
|<tt>[[Java_API:Composite_Objects#searchRecords|searchRecords]](String compositeObject, String fields, String criteria [, Parameters params])</tt>||Search and retrieve [[Composite Object]] records. <tt>fields</tt> is a comma-separated list of fields to fetch. <tt>criteria</tt> is a [[JAVA API:Filter Expressions in JAVA APIs|Filter Expression]] || [[Result Class|Result object]]|| [[Java_API:Composite_Objects|Composite Objects]]


|-
|-
|<tt>[[Java_API:Composite_Objects#searchRecords|searchRecords]](String compositeObject, String fields, String criteria, String sortBy, String sortOrder, String sortBy2, String sortOrder2, int offset, int numberOfRows [, Parameters params])</tt>||Search and retrieve [[Composite Object]] records. <tt>fields</tt> is a comma-separated list of fields to fetch. <tt>criteria</tt> is a [[Filter Expressions in JAVA APIs|Filter Expression]] || [[Result Class|Result object]]|| [[Java_API:Composite_Objects|Composite Objects]]
|<tt>[[Java_API:Composite_Objects#searchRecords|searchRecords]](String compositeObject, String fields, String criteria, String sortBy, String sortOrder, String sortBy2, String sortOrder2, int offset, int numberOfRows [, Parameters params])</tt>||Search and retrieve [[Composite Object]] records. <tt>fields</tt> is a comma-separated list of fields to fetch. <tt>criteria</tt> is a [[JAVA API:Filter Expressions in JAVA APIs|Filter Expression]] || [[Result Class|Result object]]|| [[Java_API:Composite_Objects|Composite Objects]]


|}
|}

Revision as of 21:50, 4 October 2011

These APIs are defined in the Functions class.

Record Handling

Syntax Description Return Category
addRecord(String objectName, Params params) Adds a new record of type objectId with values from params Result object Record Handling
updateRecord(String objectName, String recordId, Params params) Updates record of type objectId with values params. The Record is identified by recordId Result object Record Handling
changeOwnerShipInfo(String object_id, String record_id, String owner_id) Changes the owner of the designated record None Record Handling
deleteRecorddeleteRecord(String objectName, String recordId) Deletes Record of type objectId where id is recordId Result object Record Handling
getRecord(String objectName, String fields, String recordId) Gets the record of type objectId identified by recordId. fields is a comma separated list of fields that you want to fetch Result object Record Handling
getRecordCount(String objectName, String criteria) Returns the number of records in the object int Record Handling
searchRecords(String objectName, String fields, String criteria [, Parameters params]) Search and retrieve the records for an object. fields is a comma-separated list of fields to fetch. criteria is a Filter Expression Result object Record Handling
searchRecords(String objectName, String fields, String criteria, String sortBy, String sortOrder, String sortBy2, String sortOrder2, int offset, int numberOfRows [, Parameters params]) Search and retrieve records for an object. fields is a comma-separated list of fields to fetch. criteria is a Filter Expression Result object Record Handling
getRecord(String compositeObject, String fields, String recordId) Get a [{Composite Object]] record, with specified fields. Result object Composite Objects
getRecordCount(String compositeObject, String criteria) Gets a count of records in a Composite Object that match specified filtering criteria. int Composite Objects
searchRecords(String compositeObject, String fields, String criteria [, Parameters params]) Search and retrieve Composite Object records. fields is a comma-separated list of fields to fetch. criteria is a Filter Expression Result object Composite Objects
searchRecords(String compositeObject, String fields, String criteria, String sortBy, String sortOrder, String sortBy2, String sortOrder2, int offset, int numberOfRows [, Parameters params]) Search and retrieve Composite Object records. fields is a comma-separated list of fields to fetch. criteria is a Filter Expression Result object Composite Objects

Utility

Syntax Description Return Category
addEvent(String subject, String ownerID, Date startDate, int hour, int min, int duration [, Parameters params]) Adds an event with values from params Result object Event and Task Management
addSavePoint(String name) Adds a Save Point with name None Utility
addTask(String subject, Date dueDate, String ownerId [, Parameters params]) Adds a task with values from params Result object Event and Task Management
debug(Object obj) Puts a debug statement into the debug log for Object obj. obj can be a String also None Utility
deleteEvent(String eventId) Deletes the event for the eventId Result object Event and Task Management
deleteTask(String recordId) Deletes a task for the taskId Result object Event and Task Management
doesSavePointExist(String name) checks whether specified save point with name is exist or not Boolean Utility
exec(String functionName, Parameters params) Executes function functionName with params as input. Note that this params object is visible in functionName as functionParams The return value is defined by the function Utility
generateDocument(String objectName, String recordId, String templateId, String format) Generates document of templateId evaluated with params in format. If format is "PDF" it generates the document in PDF format, otherwise HTML format. It relates this generated document to object of type objectId and record with id recordId Result object Email and Document Management
getAllSavePoints() Returns All Save Points Set Utility
getEnv(String key) Gets the environment variable value for the key The value of the environment variable Utility
getParametersInstance() Gets an instance of Parameters class Utility Parameters object
logActivity(String subject, String objectName, String id, String activityByID, Parameters params) Logs an activity Result object Event and Task Management
processWorkflowAction(String workflowName,String currentStateName,String recordId,String customObjectName,String workflowAction,String workflowComments) Process Work flow Action Result object Workflow Record Handling
removeSavePoint(String name) removes save point with name from save point list None Utility
rollback() Roll backs all the inserts and updates None Utility
rollbackToSavePoint(String name) Rollback to specific save point with name None Utility
sendEmail(String objectName, String id, String to, String cc, String subject, String body, String attachmentTemplateId, String attachmentIdList) Sends an Email Result object Email and Document Management
sendEmailUsingTemplate(String objectName, String recordId, String to, String cc, String subject, String bodyTemplateId, String attachmentTemplateId, String attachmentIdList) Sends an Email evaluating Template identified by bodyTemplateId as email body Result object Email and Document Management
setTargetPage(String url) Sets the target page None Utility
showMessage(long millisecs) Displays message None Utility
sleep(String message) Sleeps for the designated number of milliseconds. None Utility
throwError(String message) Throws error with the message None Utility
updateEvent(String eventId, Parameters params) Updates an event with values in params Result object Event and Task Management
updateTask(String taskId, Parameters params) Updates a task with values in params Result object Event and Task Management


Metadata Management

Syntax Description Return Category
getObjectMetaData(String objectName) Retrieve metadata from a Custom Objects. CustomObjectMetaDataBean Customize
getObjectMetaDataMap() Return a map of all visible Custom Object object metadata records, indexed by object ID. Map: Object ID => CustomObjectMetaDataBean Customize
addObjectMetaData(CustomObjectMetaDataBean) Create a new object. String:Object ID Customize
updateObjectMetaData(CustomObjectMetaDataBean) Modify an object definition. String: Object ID Customize
deleteObjectMetaData(CustomObjectMetaDataBean) Deletes an object None Customize
getRecordLocator(String objectName) Get an object's Record Locator information. RecordLocatorBean Customize
updateRecordLocator(RecordLocatorBean) Modify an object's Record Locator Settings. String:Object ID Customize