Difference between revisions of "Java API Cheatsheet"

From AgileApps Support Wiki
imported>Aeric
(Created page with "These APIs are defined in the [http://lj.platformatyourservice.com/lj80/download/javadocs/com/platform/api/Functions.html Functions] class. {| border="1" cellpadding="5" cellspa…")
Β 
imported>Aeric
Line 6: Line 6:
!Return
!Return
!Category
!Category
!API Detail
|-width="150"
|-width="150"
|<tt>addEvent (String subject, String ownerID, Date startDate, int hour, int min, int duration [, Parameters params])</tt>||Adds an event with values from params|| [[Result Class|Result object]]|| [[Java_API:Event_and_Task_Management|Event and Task Management]]|| [[Java_API:Event_and_Task_Management#addEvent|<tt>addEvent</tt>]]
|<tt>[[Java_API:Event_and_Task_Management#addEvent|addEvent]](String subject, String ownerID, Date startDate, int hour, int min, int duration [, Parameters params])</tt>||Adds an event with values from params|| [[Result Class|Result object]]|| [[Java_API:Event_and_Task_Management|Event and Task Management]] Β 
|-
|-
|<tt>addRecord (String objectName, Params params)</tt>||Adds a new record of type objectId with values from params|| [[Result Class|Result object]]|| [[Java_API:Record_Handling|Record Handling]]|| [[Java API:Record_Handling#addRecord|<tt>addRecord</tt>]]
|<tt>[[Java API:Record_Handling#addRecord|addRecord]](String objectName, Params params)</tt>||Adds a new record of type objectId with values from params|| [[Result Class|Result object]]|| [[Java_API:Record_Handling|Record Handling]] Β 
|-
|-
|<tt>addSavePoint (String name)</tt>||Adds a Save Point with name|| None|| [[Java_API:Utility|Utility]]|| [[Java_API:Utility#addSavePoint |<tt> addSavePoint </tt>]]
|<tt>[[Java_API:Utility#addSavePoint |addSavePoint]](String name)</tt>||Adds a Save Point with name|| None|| [[Java_API:Utility|Utility]]
|-
|-
|<tt>addTask (String subject, Date dueDate, String ownerId [, Parameters params])</tt>||Adds a task with values from params|| [[Result Class|Result object]]|| [[Java_API:Event_and_Task_Management|Event and Task Management]]|| [[Java_API:Event_and_Task_Management#addTask|<tt>addTask</tt>]]
|<tt>[[Java_API:Event_and_Task_Management#addTask|addTask]](String subject, Date dueDate, String ownerId [, Parameters params])</tt>||Adds a task with values from params|| [[Result Class|Result object]]|| [[Java_API:Event_and_Task_Management|Event and Task Management]]
|-
|-
|<tt>changeOwnerShipInfo(String object_id, String record_id, String owner_id)</tt>||Changes the owner of the designated record|| None|| [[Java_API:Record_Handling|Record Handling]] || [[Java_API:Record_Handling#changeOwnerShipInfo|changeOwnerShipInfo]]
|<tt>[[Java_API:Record_Handling#changeOwnerShipInfo|changeOwnerShipInfo]](String object_id, String record_id, String owner_id)</tt>||Changes the owner of the designated record|| None|| [[Java_API:Record_Handling|Record Handling]]
|-
|-
|<tt>debug (Object obj)</tt>||Puts a debug statement into the debug log for Object obj. obj can be a String also|| None|| [[Java_API:Utility|Utility]]|| [[Java_API:Utility#debug |<tt> debug </tt>]]
|<tt>[[Java_API:Utility#debug |debug]](Object obj)</tt>||Puts a debug statement into the debug log for Object obj. obj can be a String also|| None|| [[Java_API:Utility|Utility]]
|-
|-
|<tt>deleteEvent (String eventId)</tt>||Deletes the event for the eventId|| [[Result Class|Result object]]|| [[Java_API:Event_and_Task_Management|Event and Task Management]]|| [[Java_API:Event_and_Task_Management#deleteEvent | <tt> deleteEvent </tt>]]
|<tt>[[Java_API:Event_and_Task_Management#deleteEvent|deleteEvent]](String eventId)</tt>||Deletes the event for the eventId|| [[Result Class|Result object]]|| [[Java_API:Event_and_Task_Management|Event and Task Management]]
|-
|-
|<tt>deleteRecord (String objectName, String recordId)</tt>||Deletes Record of type objectId where id is recordId|| [[Result Class|Result object]]|| [[Java_API:Record_Handling|Record Handling]]|| [[Java API:Record_Handling#deleteRecord |<tt> deleteRecord </tt>]]
|<tt>[[Java API:Record_Handling#deleteRecord |deleteRecord]]deleteRecord(String objectName, String recordId)</tt>||Deletes Record of type objectId where id is recordId|| [[Result Class|Result object]]|| [[Java_API:Record_Handling|Record Handling]] Β 
|-
|-
|<tt>deleteTask (String recordId)</tt>||Deletes a task for the taskId|| [[Result Class|Result object]]|| [[Java_API:Event_and_Task_Management|Event and Task Management]]|| [[Java_API:Event_and_Task_Management#deleteTask |<tt> deleteTask</tt>]]
|<tt>[[Java_API:Event_and_Task_Management#deleteTask|deleteTask]](String recordId)</tt>||Deletes a task for the taskId|| [[Result Class|Result object]]|| [[Java_API:Event_and_Task_Management|Event and Task Management]]
|-
|-
|<tt>doesSavePointExist (String name)</tt>||checks whether specified save point with name is exist or not|| Boolean|| [[Java_API:Utility|Utility]]|| [[Java_API:Utility#doesSavePointExist |<tt> doesSavePointExist </tt>]]
|<tt>[[Java_API:Utility#doesSavePointExist |doesSavePointExist]](String name)</tt>||checks whether specified save point with name is exist or not|| Boolean|| [[Java_API:Utility|Utility]]
|-
|-
|<tt>exec (String functionName, Parameters params)</tt>||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|| [[Java_API:Utility|Utility]]|| [[Java_API:Utility#exec |<tt> exec </tt>]]
|<tt>[[Java_API:Utility#exec |exec]](String functionName, Parameters params)</tt>||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|| [[Java_API:Utility|Utility]]
|-
|-
|<tt>generateDocument (String objectName, String recordId, String templateId, String format)</tt>||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 Class|Result object]]|| [[Java_API:Email_and_Document_Management|Email and Document Management]]|| [[Java API:Email_and_Document_Management#generateDocument |<tt> generateDocument</tt>]]
|<tt>[[Java API:Email_and_Document_Management#generateDocument |generateDocument</tt>]](String objectName, String recordId, String templateId, String format)</tt>||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 Class|Result object]]|| [[Java_API:Email_and_Document_Management|Email and Document Management]]
|-
|-
|<tt>getAllSavePoints()</tt>||Returns All Save Points|| Set|| [[Java_API:Utility|Utility]]|| [[Java_API:Utility#getAllSavePoints|<tt> getAllSavePoints</tt>]]
|<tt>[[Java_API:Utility#getAllSavePoints|getAllSavePoints</tt>]]()</tt>||Returns All Save Points|| Set|| [[Java_API:Utility|Utility]]
|-
|-
|<tt>getEnv (String key)</tt>||Gets the environment variable value for the key|| The value of the environment variable || [[Java_API:Utility|Utility]] ||[[Java_API:Utility#getEnv |<tt> getEnv </tt>]]
|<tt>[[Java_API:Utility#getEnv |getEnv]](String key)</tt>||Gets the environment variable value for the key|| The value of the environment variable || [[Java_API:Utility|Utility]]
|-
|-
|<tt>Functions.getParametersInstance()</tt>||Gets an instance of Parameters class||[[Java_API:Utility|Utility]] ||[[Parameters Class|Parameters object]]||[[Java_API:Utility#getParametersInstance |<tt> getParametersInstance </tt>]]
|<tt>[[Java_API:Utility#getParametersInstance |getParametersInstance]]()</tt>||Gets an instance of Parameters class|| [[Java_API:Utility|Utility]] || [[Parameters Class|Parameters object]]
|-
|-
|<tt>getRecord (String objectName, String fields, String recordId)</tt>||Gets the record of type objectId identified by recordId. fields is a comma separated list of fields that you want to fetch|| [[Result Class|Result object]]|| [[Java_API:Record_Handling|Record Handling]]|| [[Java API:Record_Handling#getRecord |<tt> getRecord </tt>]]
|<tt>[[Java API:Record_Handling#getRecord|getRecord]](String objectName, String fields, String recordId)</tt>||Gets the record of type objectId identified by recordId. fields is a comma separated list of fields that you want to fetch|| [[Result Class|Result object]]|| [[Java_API:Record_Handling|Record Handling]]
|-
|-
|<tt>logActivity (String subject, String objectName, String id, String activityByID, Parameters params)</tt>||Logs an activity|| [[Result Class|Result object]]|| [[Java_API:Event_and_Task_Management|Event and Task Management]]|| [[Java_API:Event_and_Task_Management#logActivity |<tt> logActivity </tt>]]
|<tt>[[Java_API:Event_and_Task_Management#logActivity |logActivity]](String subject, String objectName, String id, String activityByID, Parameters params)</tt>||Logs an activity|| [[Result Class|Result object]]|| [[Java_API:Event_and_Task_Management|Event and Task Management]]
|-
|-
|<tt>processWorkflowAction (String workflowName,String currentStateName,String recordId,String customObjectName,String workflowAction,String workflowComments)</tt>||Process Work flow Action|| [[Result Class|Result object]]|| [[Java_API:Record_Handling|Record Handling]]|| [[Java_API:Record_Handling#processWorkflowAction |<tt> processWorkflowAction </tt>]]
|<tt>[[Java_API:Record_Handling#processWorkflowAction |processWorkflowAction]](String workflowName,String currentStateName,String recordId,String customObjectName,String workflowAction,String workflowComments)</tt>||Process Work flow Action|| [[Result Class|Result object]]|| [[Java_API:Record_Handling|Record Handling]]
|-
|-
|<tt>removeSavePoint (String name)</tt>||removes save point with name from save point list|| None|| [[Java_API:Utility|Utility]]|| [[Java_API:Utility#removeSavePoint |<tt> removeSavePoint </tt>]]
|<tt>[[Java_API:Utility#removeSavePoint|removeSavePoint]](String name)</tt>||removes save point with name from save point list|| None|| [[Java_API:Utility|Utility]]
|-
|-
|<tt>rollback ()</tt>||Roll backs all the inserts and updates|| None|| [[Java_API:Utility|Utility]]|| [[Java_API:Utility#rollback |<tt> rollback </tt>]]
|<tt>[[Java_API:Utility#rollback |rollback]]()</tt>||Roll backs all the inserts and updates|| None|| [[Java_API:Utility|Utility]]
|-
|-
|<tt>rollbackToSavePoint (String name)</tt>||Rollback to specific save point with name|| None|| [[Java_API:Utility|Utility]]|| [[Java_API:Utility#rollbackToSavePoint |<tt> rollbackToSavePoint </tt>]]
|<tt>[[Java_API:Utility#rollbackToSavePoint|rollbackToSavePoint]](String name)</tt>||Rollback to specific save point with name|| None|| [[Java_API:Utility|Utility]]
|-
|-
|<tt>searchRecords (String objectName, String fields, String criteria [, Parameters params])</tt>||Search and retrieve the records, for object of type <tt>objectId</tt>. <tt>fields</tt> is a comma-separated list of fields that you want to fetch and criteria is expressed in filter language|| [[Result Class|Result object]]|| [[Java_API:Record_Handling|Record Handling]]|| [[Java API:Record_Handling#searchRecords |<tt> searchRecords </tt>]]
|<tt>[[Java_API:Record_Handling#searchRecords|searchRecords]](String objectName, String fields, String criteria [, Parameters params])</tt>||Search and retrieve the records, for object of type <tt>objectId</tt>. <tt>fields</tt> is a comma-separated list of fields that you want to fetch and criteria is expressed in filter language|| [[Result Class|Result object]]|| [[Java_API:Record_Handling|Record Handling]]|| Β 
|-
|-
|<tt>sendEmail (String objectName, String id, String to, String cc, String subject, String body, String attachmentTemplateId, String attachmentIdList)</tt>||Sends an Email|| [[Result Class|Result object]]|| [[Java_API:Email_and_Document_Management|Email and Document Management]]|| [[Java API:Email_and_Document_Management#sendEmail |<tt> sendEmail </tt>]]
|<tt>[[Java API:Email_and_Document_Management#sendEmail |sendEmail]](String objectName, String id, String to, String cc, String subject, String body, String attachmentTemplateId, String attachmentIdList)</tt>||Sends an Email|| [[Result Class|Result object]]|| [[Java_API:Email_and_Document_Management|Email and Document Management]]
|-
|-
|<tt>sendEmailUsingTemplate (String objectName, String recordId, String to, String cc, String subject, String bodyTemplateId, String attachmentTemplateId, String attachmentIdList)</tt>||Sends an Email evaluating Template identified by bodyTemplateId as email body|| [[Result Class|Result object]]|| [[Java_API:Email_and_Document_Management|Email and Document Management]]|| [[Java API:Email_and_Document_Management#sendEmailUsingTemplate|<tt> sendEmailUsingTemplate </tt>]]
|<tt>[[Java_API:Email_and_Document_Management#sendEmailUsingTemplate|sendEmailUsingTemplate]](String objectName, String recordId, String to, String cc, String subject, String bodyTemplateId, String attachmentTemplateId, String attachmentIdList)</tt>||Sends an Email evaluating Template identified by bodyTemplateId as email body|| [[Result Class|Result object]]|| [[Java_API:Email_and_Document_Management|Email and Document Management]]
|-
|-
|<tt>setTargetPage (String url)</tt>||Sets the target page|| None|| [[Java_API:Utility|Utility]]|| [[Java_API:Utility#setTargetPage|<tt>setTargetPage </tt>]]
|<tt>[[Java_API:Utility#setTargetPage|setTargetPage]](String url)</tt>||Sets the target page|| None|| [[Java_API:Utility|Utility]]
|-
|-
|<tt>showMessage (long millisecs)</tt>||Displays message|| None|| [[Java_API:Utility|Utility]]|| [[Java_API:Utility#showMessage|<tt>showMessage </tt>]]
|<tt>[[Java_API:Utility#showMessage|showMessage]](long millisecs)</tt>||Displays message|| None|| [[Java_API:Utility|Utility]]
|-
|-
|<tt>sleep(String message)</tt>||Sleeps for the designated number of milliseconds.|| None || [[Java_API:Utility|Utility]]|| [[Java_API:Utility#sleep|<tt>sleep </tt>]]
|<tt>[[Java_API:Utility#sleep|sleep]](String message)</tt>||Sleeps for the designated number of milliseconds.|| None || [[Java_API:Utility|Utility]]
|-
|-
|<tt>throwError (String message)</tt>||Throws error with the message|| None|| [[Java_API:Utility|Utility]]|| [[Java_API:Utility#throwError|<tt>throwError </tt>]]
|<tt>[[Java_API:Utility#throwError|throwError]](String message)</tt>||Throws error with the message|| None|| [[Java_API:Utility|Utility]]
|-
|-
|<tt>updateEvent (String eventId, Parameters params)</tt>||Updates an event with values in params|| [[Result Class|Result object]]|| [[Java API:Event_and_Task_Management|Event and Task Management]]|| [[Java_API:Event_and_Task_Management#updateEvent|<tt>updateEvent </tt>]]
|<tt>[[Java_API:Event_and_Task_Management#updateEvent|updateEvent]](String eventId, Parameters params)</tt>||Updates an event with values in params|| [[Result Class|Result object]]|| [[Java API:Event_and_Task_Management|Event and Task Management]]
|-
|-
|<tt>updateRecord (String objectName, String recordId, Params params)</tt>||Updates record of type objectId with values params. The Record is identified by recordId|| [[Result Class|Result object]]|| [[Java_API:Record_Handling|Record Handling]]|| [[Java API:Record_Handling#updateRecord |<tt> updateRecord </tt>]]
|<tt>[[Java_API:Record_Handling#updateRecord|updateRecord]](String objectName, String recordId, Params params)</tt>||Updates record of type objectId with values params. The Record is identified by recordId|| [[Result Class|Result object]]|| [[Java_API:Record_Handling|Record Handling]]
|-
|-
|<tt>updateTask (String taskId, Parameters params)</tt>||Updates a task with values in params|| [[Result Class|Result object]]|| [[Java_API:Event_and_Task_Management|Event and Task Management]]|| [[Java_API:Event_and_Task_Management#updateTask |<tt> updateTask </tt>]]
|<tt>[[Java_API:Event_and_Task_Management#updateTask|updateTask]](String taskId, Parameters params)</tt>||Updates a task with values in params|| [[Result Class|Result object]]|| [[Java_API:Event_and_Task_Management|Event and Task Management]]
|}
|}

Revision as of 21:44, 28 September 2011

These APIs are defined in the Functions class.

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
addRecord(String objectName, Params params) Adds a new record of type objectId with values from params Result object Record Handling
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
changeOwnerShipInfo(String object_id, String record_id, String owner_id) Changes the owner of the designated record None Record Handling
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
deleteRecorddeleteRecord(String objectName, String recordId) Deletes Record of type objectId where id is recordId Result object Record Handling
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
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
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 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
searchRecords(String objectName, String fields, String criteria [, Parameters params]) Search and retrieve the records, for object of type objectId. fields is a comma-separated list of fields that you want to fetch and criteria is expressed in filter language Result object Record Handling
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
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
updateTask(String taskId, Parameters params) Updates a task with values in params Result object Event and Task Management