com.platform.api
Class Functions

java.lang.Object
  extended by com.platform.api.Functions

public class Functions
extends Object


Field Summary
static String __SQL_STR__
           
static Map customers
           
static String DEBUG_MESSAGES_LIST
           
static String SAVEPOINTMAPKEY
           
static String SCRIPT_EXECUTION_STACK_KEY
           
 
Constructor Summary
Functions()
           
 
Method Summary
static Result addAuditLog(String referenceId, String descriptionKey, String typeCode, String operationCode, String objectKey, String oldName, String newName, Parameters params)
          Adding audit log entry
static Result addEvent(String subject, String ownerID, Date startDate, int hour, int min, int duration)
          This method Adds an event with specified values.
static Result addEvent(String subject, String ownerID, Date startDate, int hour, int min, int duration, Parameters params)
          This method Adds an event with specified values.
static String addFieldMetaData(FieldMetaDataBean fmdb)
          This method return the meta data information of specified field of an object
static String addGlobalPicklist(GlobalPicklistBean bean)
          Add Global Picklist
static String addObjectMetaData(CustomObjectMetaDataBean omdb)
          This method adds a particular object
static Result addRecord(String objectId, Parameters params)
          This method Adds a new record of type objectId with values from params.
static Result addRecord(String objectId, Parameters params, TenantContext tenantContext)
          This method Adds a new record of type objectId with values from params in specified Tenant.
static void addSavePoint(String name)
          This method Adds a SavePoint with the string name.
static String addSocialFeed(SocialFeedBean sfb)
          Add Social Feed
static String addSocialGroup(SocialGroupBean sgb)
          Add Social Group
static Result addTask(String subject, Date dueDate, String ownerId)
          This method Adds a task with values from params.
static Result addTask(String subject, Date dueDate, String ownerId, Parameters params)
          This method Adds a task with values from params.
static Result addToRecordForImport(HashMap paramsToRecord)
           
static Result changeOwnerShipInfo(String objectId, String recordId, String ownerId, boolean notifyOwner)
          This method does ownership change and sends notification email to the new owner
static void clearUserRequestContext(Thread thread)
           
static void createUserRequestContext(Thread thread)
           
static void debug(Object o)
          This method Logs a debug message.
static void debug(String debugMessage)
          This method Logs a debug message.
static Result deleteEvent(String eventId)
          This method Deletes the event of the specified eventID.
static void deleteFieldMetaData(FieldMetaDataBean fmdb)
          This method return the meta data information of specified field of an object
static void deleteGlobalPicklist(String id)
          Delete Global Picklist
static Result deleteJob(String jobId)
          This method will be called when user requests for deleting the scheduled job
static void deleteObjectMetaData(CustomObjectMetaDataBean omdb)
          This method deletes a particular object
static Result deleteRecord(String objectId, String id)
          This Method deletes the specified Record
static Result deleteRecord(String objectId, String id, Parameters params)
          This Method deletes the specified Record, This is a overloaded method which takes Parameters Instance also, This method is useful if user would like to skip the data policy on delete or use the parameters to other data policies, all these can be possible through the params.
static Result deleteRecord(String objectId, String id, TenantContext tenantContext)
          This Method deletes the specified Record in specified tenant
static void deleteSocialFeed(String feedId)
          Delete Social Feed
static void deleteSocialGroup(String groupId)
          Delete Social Group
static Result deleteTask(String record_id)
          This Method Deletes a task for the taskId.
static boolean doesSavePointExist(String name)
          This method Checks whether SavePoint exists with the string name.
static Object exec(String functionName, Parameters params)
          This method Executes sepecified function.
static Result execSQL(String sql)
           
static Result generateDocument(String objectId, String id, String templateId, String format)
          This Method Generates document of templateId evaluated with params in the format.
static AccessProfileBean getAccessProfileBean(String accessProfileId)
           
static Set getAllSavePoints()
          This method Returns Set of all Save Points.
static long getCurrentCPUTime()
          This method is used to get the current CPU Time.
static long getCurrentStatmentCount()
          This method is used to get the current Statmement counter.
static long getCurrentStringSize()
          This method is used to get the current String size.
static String getEnv(String key)
          This method Gets the environment variable value for the key
static StringBuilder getExecSQLFunctions()
           
static FieldMetaDataBean getFieldMetaData(String objectName, String fieldName)
          This method return the meta data information of specified field of an object
static FieldMetaDataBean getFieldMetaData(String objectName, String fieldName, TenantContext tenantContext)
          This method return the meta data information of specified field of an object
static Map getFieldMetaDataMap(String objectName)
          This method returns the meta data information of all the fields of an object
static StringBuilder getGetWFOwnersFunction()
          Deprecated. 
static GlobalPicklistBean getGlobalPicklist(String id)
          Get Global Picklist
static IndexBean getIndex(String objectName, String indexName)
          This method returns details of the index for specified object and specified index
static Map getIndexesMap(String objectName)
          This method returns the list of indexes of specified object
static Map getLoggedInUserInfo()
          This method gets a logged in user info
static HashMap getMappingProfiles(String objectName)
          gets the list of mapping profiles for the specified object
static long getMaxCPUTimeLimit()
          This method is used to get Maximum CPU Time that is defined in Service Configurations.
static long getMaxStatementCounterLimit()
          This method is used to get Maximum Statement counter that is defined in Service Configurations.
static long getMaxStringSizeLimit()
          This method is used to get Maximum String size limit that is defined in Service Configurations.
static CustomObjectMetaDataBean getObjectMetaData(String objectName)
          This method returns the meta data information of specified object
static Map getObjectMetaDataMap()
          This method returns the meta data information of all the objects available to user
static Parameters getParametersInstance()
          This method Gets an instance of the Parameters class
static Object getProcessVariable(String variableName)
           
static Object getProcessVariable(String processInstanceId, String variableName)
           
static Result getRecord(String objectId, String columns, String recordId)
          This method gets the record with specified fields.
static Result getRecord(String objectId, String columns, String recordId, Parameters scriptingParams)
          This method gets the record with specified fields.
static Result getRecord(String objectId, String columns, String recordId, TenantContext tenantContext)
          This method gets the record with specified fields for the specified Tenant
static Result getRecord(String objectId, String columns, String recordId, TenantContext tenantContext, Parameters scriptingParams)
          This method gets the record with specified fields for a specified Tenant.
static int getRecordCount(String objectId, String criteria)
          This method returns the number of records in the objects and results depends on the criteria.
static int getRecordCount(String objectId, String criteria, TenantContext tenantContext)
          This method returns the number of records and results depends on the criteria in a specified tenant
static RecordLocatorBean getRecordLocator(String objectName)
          This method returns the record locator for a particular object
static RoleBean getRoleBean(String roleId)
          returns role information based on role id
static SocialFeedBean getSocialFeed(String id)
          Get feed posting
static CollectionBean getSocialFollowers(String type, String id, String objectId, String filter)
          Get the list of Followers for a resource
static CollectionBean getSocialFollowing(String userId, String filter)
          Get list of what is user following
static SocialGroupBean getSocialGroup(String groupId)
          Get Social Group
static int getSocialNotificationsCount()
          Get new notifications count
static List getSocialNotificationsList(boolean newOnly)
          Get list of notifications
static CollectionBean getSocialVotes(String id, String action, String filter)
          Get the list of votes for specified resource and action
static StatusBean getStatus(String resourceName, String id)
          Get status of the following operations: package deployment | import
static String getTaskOwner(String taskDefKey)
           
static String getTaskOwner(String processInstanceId, String taskDefKey)
           
static Map getTimezonesUtility()
          This method return the list of time zones
static com.platform.beans.TimeZoneBean getTimezoneUtility(String timezoneId)
          This method return time zone given time zone number
static RecordBean getWFOwners(String objectId, String recordId)
          Deprecated. 
static Map getWorkflowActionList(String objectName, String recordId)
          This method return the list of workflow actions given objectName and recordId
static RecordBean getWorkflowOwners(String objectId, String recordId)
          Get the list of Workflow Owners given object Id and record Id
static String globalTranslateToken(String key)
          This method accesses a Custom Label (a message) defined in the Translation Workbench of Global Tenant
static String globalTranslateToken(String key, String[] args)
          This method accesses a Custom Label (a message) defined in the Translation Workbench of Global Tenant
static String importData(String objectName, String mappingProfile, PlatformFileBean fileBean)
           
static Result logActivity(String subject, String objectId, String id, String activityByID, Parameters params)
          This method Logs an activity in a record; Logged activities appear in the Activity History section of Related Information.
static Result processWorkflowAction(String workflowName, String currentStateName, String recordId, String customObjectName, String workflowAction, String workflowComments, String userChoiceOwner)
          This method process the workflow for specified workflow and workflow action Supports Workflow processes, taking workflow actions on records, based on the current workflow state
static LoginResponseBean proxyLogin(String proxyUserId)
          proxy login to user with given userId
static Result removeFromRecordForImport(HashMap paramsToRecord)
           
static void removeSavePoint(String name)
          This method Removes the specified SavePoint from a list of SavePoints.
static String replaceTemplateVariables(String text, String objectId, String recordId)
           
static String replaceTemplateVariables(String text, String objectId, String recordId, TenantContext tenantContext)
          This method is used to mail merge using tenant context
static void rollback()
          This method roll backs entire transaction.
static void rollbackToSavePoint(String name)
          This method Rollback the transaction to the SavePoint with the string name.
static String schedule(String jobName, Schedulable schedulable, String cronExp)
          This method schedules a job
static String schedule(String jobName, Schedulable schedulable, String cronExp, String userId)
          Schedules and the job will be run with the specified user's permission
static String schedule(String jobName, Schedulable schedulable, String cronExp, String userId, String endDate)
           
static List searchGlobalPicklists(SearchContext searchContext)
          Search Global Picklist
static Result searchRecords(SearchContext searchContext)
          This method is used to search the records using Search Context SearchContext has to filled with valid objectId, field List etc.
static Result searchRecords(String objectId, String fields, String criteria)
          This method Search and retrieve the records for an object.
static Result searchRecords(String objectId, String fields, String criteria, Parameters params)
          This method Search and retrieve the records for an object.
static Result searchRecords(String objectId, String fields, String criteria, String sortBy, String sortOrder, String sortBy2, String sortOrder2, int offset, int numberOfRows)
          This method Search and retrieve the records for an object.
static Result searchRecords(String objectId, String fields, String criteria, String sortBy, String sortOrder, String sortBy2, String sortOrder2, int offset, int numberOfRows, Parameters params)
          This method Search and retrieve the records for an object.
static Result searchRecords(String objectId, String fields, String criteria, String sortBy, String sortOrder, String sortBy2, String sortOrder2, int offset, int numberOfRows, TenantContext tenantContext)
          This method Search and retrieve the records for an object.
static Result searchRecords(String objectId, String fields, String criteria, String sortBy, String sortOrder, String sortBy2, String sortOrder2, int offset, int numberOfRows, TenantContext tenantContext, Parameters params)
          This method Search and retrieve the records for an object for a specified Tenant.
static Result searchRecords(String objectId, String columns, String criteria, TenantContext tenantContext)
          This method Search and retrieve the records for an object in specified Tenant
static Result searchRecords(String objectId, String columns, String criteria, TenantContext tenantContext, Parameters params)
          This method Search and retrieve the records for an object in specified Tenant.
static List searchSocialFeeds(SearchContext searchContext)
          Get the list of Social Feeds
static List searchSocialGroups(SearchContext searchContext)
          Get the list of Social Groups
static CollectionBean searchStatus(String resourceName, String fields, String criteria)
          Search status of the operation
static Result sendEmail(String objectId, String id, String to, String cc, String subject, String body, String attachmentTemplateId, String attachmentIdList)
          This method Sends a E-mail
static Result sendEmail(String objectId, String id, String to, String cc, String bcc, String subject, String body, String attachmentTemplateId, String attachmentIdList)
          This method Sends a E-mail
static Result sendEmail(String objectId, String id, String to, String cc, String subject, String body, String attachmentTemplateId, String attachmentIdList, TenantContext tenantContext)
          This method Sends a E-mail for another tenant Record ID using Tenant Context.
static Result sendEmailUsingTemplate(String objectId, String id, String to, String cc, String subject, String bodyTemplateId, String attachmentTemplateId, String attachmentIdList)
          This method Sends an Email message evaluating the Template identified by bodyTemplateId as the body of the email message.
static Result sendEmailUsingTemplate(String objectId, String id, String to, String cc, String bcc, String subject, String bodyTemplateId, String attachmentTemplateId, String attachmentIdList)
          This method Sends an Email message evaluating the Template identified by bodyTemplateId as the body of the email message.
static Result sendEmailUsingTemplate(String objectId, String id, String to, String cc, String bcc, String subject, String bodyTemplateId, String attachmentTemplateId, String attachmentIdList, String fromName, String fromAddress)
          This method Sends an Email message evaluating the Template identified by bodyTemplateId as the body of the email message.
static void setAllSocialNotificationsRead()
          Sets all notifications read
static void setProcessVariable(String variableName, Object value)
           
static void setProcessVariable(String processInstanceId, String variableName, Object value)
           
static void setTargetPage(String url)
          This method Sets the target page, URL is the relative path
static void showMessage(String customMessage)
          This Method Displays the message in the UI, irrespective of any database insertions or updates (without interrupting the program flow)
static void showMessage(String key, String[] args)
          This Method Displays the message in the UI, irrespective of any database insertions or updates (without interrupting the program flow)
static void sleep(long milliseconds)
          Performs Thread.sleep();
static void socialFollow(SocialBean socialBean)
          Social Follow a resource
static void socialUnfollow(SocialBean socialBean)
          Social Unfollow a resource
static void socialVote(String id, String action)
          Vote a resource
static LoginResponseBean switchBack()
          Switch back to original user if current user is proxy user
static void throwError(String messageStr)
          This method throws an error with the specified message, this method stops the execution also.
static void throwError(String key, String[] args, boolean flag)
          This method throws an error with the specified message, message can be in different languages depends on the user language, it process custom label key specified in Translation workbench and also arguments.
static String translateToken(String key)
          This method accesses a Custom Label (a message) defined in the Translation Workbench
static String translateToken(String key, String[] args)
          This method accesses a Custom Label (a message) defined in the Translation Workbench
static Result updateEvent(String eventId, Parameters params)
          This method Updates an event with values in params.
static String updateFieldMetaData(FieldMetaDataBean fmdb)
          This method return the meta data information of specified field of an object
static String updateGlobalPicklist(GlobalPicklistBean bean, String id)
          Update Global Picklist
static String updateObjectMetaData(CustomObjectMetaDataBean omdb)
          This method updates a particular object
static Result updateRecord(String objectId, String id, Parameters params)
          This method Updates record of type objectId with values params.
static Result updateRecord(String objectId, String id, Parameters params, TenantContext tenantContext)
          This method Updates record of type objectId with values params in specified tenant.
static String updateRecordLocator(RecordLocatorBean rlb)
          This method updates the record locator of a particular object
static void updateSocialGroup(SocialGroupBean sgb, String groupId)
          Update Social Group
static Result updateTask(String taskId, Parameters params)
          This method Updates a task with values in params.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCRIPT_EXECUTION_STACK_KEY

public static String SCRIPT_EXECUTION_STACK_KEY

DEBUG_MESSAGES_LIST

public static String DEBUG_MESSAGES_LIST

SAVEPOINTMAPKEY

public static String SAVEPOINTMAPKEY

__SQL_STR__

public static String __SQL_STR__

customers

public static Map customers
Constructor Detail

Functions

public Functions()
Method Detail

throwError

public static void throwError(String messageStr)
                       throws Exception
This method throws an error with the specified message, this method stops the execution also.

Parameters:
messageStr - - Error Message
Throws:
Exception

throwError

public static void throwError(String key,
                              String[] args,
                              boolean flag)
                       throws Exception
This method throws an error with the specified message, message can be in different languages depends on the user language, it process custom label key specified in Translation workbench and also arguments.

Parameters:
key - Custom Label defined in Translation Workbench
args - Runtime Arguments required for the specified Custom Label
flag - boolean value determines whether to process the arguments or not, if false, this method throws what ever exists in key as error message
Throws:
Exception

translateToken

public static String translateToken(String key)
                             throws Exception
This method accesses a Custom Label (a message) defined in the Translation Workbench

Parameters:
key - - Custom Label defined in Translation Workbench
Returns:
Message - Respected Message for specified Custom Label
Throws:
Exception

translateToken

public static String translateToken(String key,
                                    String[] args)
                             throws Exception
This method accesses a Custom Label (a message) defined in the Translation Workbench

Parameters:
key - - Custom Label defined in Translation Workbench
args - - Runtime Arguments required for the specified Custom Label
Returns:
Message - Respected Message for specified Custom Label With Runtime Arguments passed
Throws:
Exception

globalTranslateToken

public static String globalTranslateToken(String key)
                                   throws Exception
This method accesses a Custom Label (a message) defined in the Translation Workbench of Global Tenant

Parameters:
key - - Custom Label defined in Translation Workbench
Returns:
Message - Respected Message for specified Custom Label
Throws:
Exception

globalTranslateToken

public static String globalTranslateToken(String key,
                                          String[] args)
                                   throws Exception
This method accesses a Custom Label (a message) defined in the Translation Workbench of Global Tenant

Parameters:
key - - Custom Label defined in Translation Workbench of Global Tenant
args - - Runtime Arguments required for the specified Custom Label
Returns:
Message - Respected Message for specified Custom Label With Runtime Arguments passed
Throws:
Exception

addRecord

public static Result addRecord(String objectId,
                               Parameters params)
                        throws Exception
This method Adds a new record of type objectId with values from params.

Parameters:
objectId - - Name or Id of the object that record to be added
params - - Record values
Returns:
Result - The record ID of the added record is available.
Throws:
Exception

updateRecord

public static Result updateRecord(String objectId,
                                  String id,
                                  Parameters params)
                           throws Exception
This method Updates record of type objectId with values params. The Record is identified by recordId.

Parameters:
objectId - - Name or Id of the object that record to be updated
id - - Record ID
params - - Values of the record
Returns:
Result - '0' for success and '-1' for failure and Actual Failures Message or Success Message available in Result.
Throws:
Exception

deleteRecord

public static Result deleteRecord(String objectId,
                                  String id)
                           throws Exception
This Method deletes the specified Record

Parameters:
objectId - - Name or Id of the object that record to be deleted
id - - Record ID that needs to be deleted
Returns:
Result - Result - '0' for success and '-1' for failure and Actual Failures Message or Success Message available in Result.
Throws:
Exception

deleteRecord

public static Result deleteRecord(String objectId,
                                  String id,
                                  Parameters params)
                           throws Exception
This Method deletes the specified Record, This is a overloaded method which takes Parameters Instance also, This method is useful if user would like to skip the data policy on delete or use the parameters to other data policies, all these can be possible through the params.

Parameters:
objectId - - Name or Id of the object that record to be added
id - - Record ID that needs to be deleted
params - - Instance of Parameters object
Returns:
Result - Result - '0' for success and '-1' for failure and Actual Failures Message or Success Message available in Result.
Throws:
Exception

getRecord

public static Result getRecord(String objectId,
                               String columns,
                               String recordId)
                        throws Exception
This method gets the record with specified fields.

Parameters:
objectId - - Name or Id of the object
columns - - Field Names that needs to be fetched.
recordId - - Record ID
Returns:
Result - Result contains the Parameters Instance which contains the record values
Throws:
Exception

searchRecords

public static Result searchRecords(String objectId,
                                   String fields,
                                   String criteria)
                            throws Exception
This method Search and retrieve the records for an object.

Parameters:
objectId - - Name or Id of the object
fields - - Field Names that needs to be fetched
criteria - - A filter expression that specifies records to select.
Returns:
Result contains the Parameters Instances which contains the records values.
Throws:
Exception

searchRecords

public static Result searchRecords(String objectId,
                                   String fields,
                                   String criteria,
                                   String sortBy,
                                   String sortOrder,
                                   String sortBy2,
                                   String sortOrder2,
                                   int offset,
                                   int numberOfRows)
                            throws Exception
This method Search and retrieve the records for an object.

Parameters:
objectId - - Name or Id of the object
fields - - Field Names that needs to be fetched
criteria - - A filter expression that specifies records to select.
sortBy - - Sort the search results on the specified field.
sortOrder - - Specify if the sort order is ascending ("asc") or descending ("desc"). The default is ascending.
sortBy2 - - Do a secondary sort on the specified field.
sortOrder2 - - Specify if the sort order on the second level is ascending ("asc") or descending ("desc"). The default is ascending.
offset - - The maximum number of records that you can retrieve in a single call to searchRecords is 5,000. If you need to retrieve more than 5,000 records, you must set up a loop where you do paging by incrementing the offset parameter.
numberOfRows - - The maximum number of records to return
Returns:
- Result contains the Parameters Instances which contains the records values.
Throws:
Exception

searchRecords

public static Result searchRecords(SearchContext searchContext)
                            throws Exception
This method is used to search the records using Search Context SearchContext has to filled with valid objectId, field List etc.

Parameters:
searchContext -
Returns:
Throws:
Exception

sendEmailUsingTemplate

public static Result sendEmailUsingTemplate(String objectId,
                                            String id,
                                            String to,
                                            String cc,
                                            String subject,
                                            String bodyTemplateId,
                                            String attachmentTemplateId,
                                            String attachmentIdList)
                                     throws Exception
This method Sends an Email message evaluating the Template identified by bodyTemplateId as the body of the email message.

Parameters:
objectId - - Name or Id of the object
id - - Record Id
to - - A list of comma-separated email addresses
cc - - A list of comma-separated email addresses
subject - - A descriptive text string
bodyTemplateId - - ID of the template created in 'Template' object. Its template is evaluated at run time, the template variables substituted, and then sent as the body of the message.
attachmentTemplateId - - A list of comma-separated print template identifiers. The template variables are evaluated at run time, their values are substituted, and the resulting documents are then sent as attachments.
attachmentIdList - - A list of comma-separated document identifiers in your documents folder to send as attachments
Returns:
Result - '0' for Success and '-1' for Failure and Actual Failure Message or Success Message available in Result
Throws:
Exception

sendEmailUsingTemplate

public static Result sendEmailUsingTemplate(String objectId,
                                            String id,
                                            String to,
                                            String cc,
                                            String bcc,
                                            String subject,
                                            String bodyTemplateId,
                                            String attachmentTemplateId,
                                            String attachmentIdList)
                                     throws Exception
This method Sends an Email message evaluating the Template identified by bodyTemplateId as the body of the email message.

Parameters:
objectId - - Name or Id of the object
id - - Record Id
to - - A list of comma-separated email addresses
cc - - A list of comma-separated email addresses
bcc - - A list of comma-separated email addresses
subject - - A descriptive text string
bodyTemplateId - - ID of the template created in 'Template' object. Its template is evaluated at run time, the template variables substituted, and then sent as the body of the message.
attachmentTemplateId - - A list of comma-separated print template identifiers. The template variables are evaluated at run time, their values are substituted, and the resulting documents are then sent as attachments.
attachmentIdList - - A list of comma-separated document identifiers in your documents folder to send as attachments
Returns:
Result - '0' for Success and '-1' for Failure and Actual Failure Message or Success Message available in Result
Throws:
Exception

sendEmailUsingTemplate

public static Result sendEmailUsingTemplate(String objectId,
                                            String id,
                                            String to,
                                            String cc,
                                            String bcc,
                                            String subject,
                                            String bodyTemplateId,
                                            String attachmentTemplateId,
                                            String attachmentIdList,
                                            String fromName,
                                            String fromAddress)
                                     throws Exception
This method Sends an Email message evaluating the Template identified by bodyTemplateId as the body of the email message.

Parameters:
objectId - - Name or Id of the object
id - - Record Id
to - - A list of comma-separated email addresses
cc - - A list of comma-separated email addresses
bcc - - A list of comma-separated email addresses
subject - - A descriptive text string
bodyTemplateId - - ID of the template created in 'Template' object. Its template is evaluated at run time, the template variables substituted, and then sent as the body of the message.
attachmentTemplateId - - A list of comma-separated print template identifiers. The template variables are evaluated at run time, their values are substituted, and the resulting documents are then sent as attachments.
attachmentIdList - - A list of comma-separated document identifiers in your documents folder to send as attachments
fromName - sender name
fromAddress - sender address
Returns:
Result - '0' for Success and '-1' for Failure and Actual Failure Message or Success Message available in Result
Throws:
Exception

sendEmail

public static Result sendEmail(String objectId,
                               String id,
                               String to,
                               String cc,
                               String subject,
                               String body,
                               String attachmentTemplateId,
                               String attachmentIdList)
                        throws Exception
This method Sends a E-mail

Parameters:
objectId - - Name or Id of the object.
id - - Record ID
to - - A list of comma-separated email addresses
cc - - A list of comma separated email addresses
subject - - A descriptive text string
body - - The contents of the email message (static text).
attachmentTemplateId - - A list of comma-separated print template identifiers. The template variables are evaluated at run time, their values are substituted, and the resulting documents are then sent as attachments
attachmentIdList - - A list of comma-separated document identifiers in your documents folder to send as attachments
Returns:
Result - '0' for Success and '-1' for Failure and Actual Failure Message or Success Message available in Result
Throws:
Exception

sendEmail

public static Result sendEmail(String objectId,
                               String id,
                               String to,
                               String cc,
                               String subject,
                               String body,
                               String attachmentTemplateId,
                               String attachmentIdList,
                               TenantContext tenantContext)
                        throws Exception
This method Sends a E-mail for another tenant Record ID using Tenant Context.

Parameters:
objectId - - Name or Id of the object.
id - - Record ID
to - - A list of comma-separated email addresses
cc - - A list of comma separated email addresses
subject - - A descriptive text string
body - - The contents of the email message (static text).
attachmentTemplateId - - A list of comma-separated print template identifiers. The template variables are evaluated at run time, their values are substituted, and the resulting documents are then sent as attachments
attachmentIdList - - A list of comma-separated document identifiers in your documents folder to send as attachments
tenantContext - - TenantContext Object used to send an email using a user-alias in another tenancy.
Returns:
Result - '0' for Success and '-1' for Failure and Actual Failure Message or Success Message available in Result
Throws:
Exception

sendEmail

public static Result sendEmail(String objectId,
                               String id,
                               String to,
                               String cc,
                               String bcc,
                               String subject,
                               String body,
                               String attachmentTemplateId,
                               String attachmentIdList)
                        throws Exception
This method Sends a E-mail

Parameters:
objectId - - Name or Id of the object.
id - - Record ID
to - - A list of comma-separated email addresses
cc - - A list of comma separated email addresses
bcc - - A list of comma separated email addresses
subject - - A descriptive text string
body - - The contents of the email message (static text).
attachmentTemplateId - - A list of comma-separated print template identifiers. The template variables are evaluated at run time, their values are substituted, and the resulting documents are then sent as attachments
attachmentIdList - - A list of comma-separated document identifiers in your documents folder to send as attachments
Returns:
Result - '0' for Success and '-1' for Failure and Actual Failure Message or Success Message available in Result
Throws:
Exception

generateDocument

public static Result generateDocument(String objectId,
                                      String id,
                                      String templateId,
                                      String format)
                               throws Exception
This Method Generates document of templateId evaluated with params in the format.

Parameters:
objectId - - Name or Id of the object.
id - - Record ID
templateId - - The name of the print template
format - - Format that can be either CONSTANT.DOCUMENT.FORMAT.HTML or CONSTANT.DOCUMENT.FORMAT.PDF
Returns:
Result - '0' for success and '-1' for failure and Actual Failures Message or Success Message available in Result.
Throws:
Exception

addTask

public static Result addTask(String subject,
                             Date dueDate,
                             String ownerId)
                      throws Exception
This method Adds a task with values from params.

Parameters:
subject - - The subject of the task
dueDate - - The date the task is due
ownerId - - The identifier of the owner
Returns:
Result - Result contains Record ID of the task.
Throws:
Exception

addTask

public static Result addTask(String subject,
                             Date dueDate,
                             String ownerId,
                             Parameters params)
                      throws Exception
This method Adds a task with values from params.

Parameters:
subject - - The subject of the task
dueDate - - The date the task is due
ownerId - - The identifier of the owner
params - - Other task field-value pairs
Returns:
Result - Result contains Record ID of the task.
Throws:
Exception

updateTask

public static Result updateTask(String taskId,
                                Parameters params)
                         throws Exception
This method Updates a task with values in params.

Parameters:
taskId - - Record ID of the TASK
params - - Field-value pairs to update in the task
Returns:
Result - '0' for success and '-1' for failure and Actual Failures Message or Success Message available in Result.
Throws:
Exception

deleteTask

public static Result deleteTask(String record_id)
                         throws Exception
This Method Deletes a task for the taskId.

Parameters:
record_id - - Record ID of the TASK
Returns:
- Result - '0' for success and '-1' for failure and Actual Failures Message or Success Message available in Result.
Throws:
Exception

addEvent

public static Result addEvent(String subject,
                              String ownerID,
                              Date startDate,
                              int hour,
                              int min,
                              int duration)
                       throws Exception
This method Adds an event with specified values.

Parameters:
subject - - The subject of the event
ownerID - - The identifier of the owner of the event
startDate - - The start date of the event
hour - - The start hour of the event
min - - The start minute of the event
duration - - The length of the event
Returns:
Result - Result contains the Event Record ID.
Throws:
Exception

addEvent

public static Result addEvent(String subject,
                              String ownerID,
                              Date startDate,
                              int hour,
                              int min,
                              int duration,
                              Parameters params)
                       throws Exception
This method Adds an event with specified values.

Parameters:
subject - - The subject of the event
ownerID - - The identifier of the owner of the event
startDate - - The start date of the event
hour - - The start hour of the event
min - - The start minute of the event
duration - - The length of the event
params - - Other field-value pairs for the event
Returns:
Result - Result contains the Event Record ID.
Throws:
Exception

logActivity

public static Result logActivity(String subject,
                                 String objectId,
                                 String id,
                                 String activityByID,
                                 Parameters params)
                          throws Exception
This method Logs an activity in a record; Logged activities appear in the Activity History section of Related Information.

Parameters:
subject - - Subject of the activity; In the browser UI, the subject is the contents of the Notes field; This argument will populate the contents of the Notes field in the record, and replace any existing data in the field
objectId - - Name or Id of the object.
id - - Record ID
activityByID - - User identifier; The name of the user who has performed this activity
params - - Other field-value pairs for the activity
Returns:
Result - Result contains the Record ID of the Activity
Throws:
Exception

updateEvent

public static Result updateEvent(String eventId,
                                 Parameters params)
                          throws Exception
This method Updates an event with values in params.

Parameters:
eventId - - Record ID of the Event
params - - Field-value pairs to update in the event
Returns:
Result - '0' for success and '-1' for failure and Actual Failures Message or Success Message available in Result.
Throws:
Exception

deleteEvent

public static Result deleteEvent(String eventId)
                          throws Exception
This method Deletes the event of the specified eventID.

Parameters:
eventId - - Record ID of the EVENT
Returns:
Result - '0' for success and '-1' for failure and Actual Failures Message or Success Message available in Result.
Throws:
Exception

getEnv

public static String getEnv(String key)
                     throws Exception
This method Gets the environment variable value for the key

Parameters:
key - - key to access the environment variables like ENV.USER.ID, ENV.USER.EMAIL ..etc.
Returns:
String - The value of the environment variable as a String.
Throws:
Exception

getParametersInstance

public static Parameters getParametersInstance()
                                        throws Exception
This method Gets an instance of the Parameters class

Returns:
Parameters - An instance of the Parameters class
Throws:
Exception

debug

public static void debug(Object o)
This method Logs a debug message.

Parameters:
o - - Puts a debug statement into the debug log for Object o.

debug

public static void debug(String debugMessage)
This method Logs a debug message.

Parameters:
debugMessage - - Puts a debug statement into the debug log.

exec

public static Object exec(String functionName,
                          Parameters params)
                   throws Exception
This method Executes sepecified function.

Parameters:
functionName - - Name of the function that needs to be executed.
params - - Instance of the Parmeters which contains key-value pairs.
Returns:
Object - Return value of the specified function
Throws:
Exception

addToRecordForImport

public static Result addToRecordForImport(HashMap paramsToRecord)
                                   throws Exception
Throws:
Exception

removeFromRecordForImport

public static Result removeFromRecordForImport(HashMap paramsToRecord)
                                        throws Exception
Throws:
Exception

addSavePoint

public static void addSavePoint(String name)
                         throws Exception
This method Adds a SavePoint with the string name.

Parameters:
name - - SavePoint Name
Throws:
Exception

rollbackToSavePoint

public static void rollbackToSavePoint(String name)
                                throws Exception
This method Rollback the transaction to the SavePoint with the string name.

Parameters:
name - - SavePoint Name
Throws:
Exception

removeSavePoint

public static void removeSavePoint(String name)
                            throws Exception
This method Removes the specified SavePoint from a list of SavePoints.

Parameters:
name - - SavaPoint Name
Throws:
Exception

doesSavePointExist

public static boolean doesSavePointExist(String name)
                                  throws Exception
This method Checks whether SavePoint exists with the string name.

Parameters:
name - - SavePoint Name
Returns:
boolean - true if SavePoint exists or false if not.
Throws:
Exception

getAllSavePoints

public static Set getAllSavePoints()
                            throws Exception
This method Returns Set of all Save Points.

Returns:
Set - All Save Points
Throws:
Exception

rollback

public static void rollback()
                     throws Exception
This method roll backs entire transaction.

Throws:
Exception

showMessage

public static void showMessage(String customMessage)
                        throws Exception
This Method Displays the message in the UI, irrespective of any database insertions or updates (without interrupting the program flow)

Parameters:
customMessage - - Custom Message that needs to displayed.
Throws:
Exception

showMessage

public static void showMessage(String key,
                               String[] args)
                        throws Exception
This Method Displays the message in the UI, irrespective of any database insertions or updates (without interrupting the program flow)

Parameters:
key - - Key for the custom message
args - - Runtime arguments that will be displayed along with message.
Throws:
Exception

setTargetPage

public static void setTargetPage(String url)
                          throws Exception
This method Sets the target page, URL is the relative path

Parameters:
url - - URL is the relative path
Throws:
Exception

processWorkflowAction

public static Result processWorkflowAction(String workflowName,
                                           String currentStateName,
                                           String recordId,
                                           String customObjectName,
                                           String workflowAction,
                                           String workflowComments,
                                           String userChoiceOwner)
                                    throws Exception
This method process the workflow for specified workflow and workflow action Supports Workflow processes, taking workflow actions on records, based on the current workflow state

Parameters:
workflowName - - Workflow name
currentStateName - - State name
recordId - - Record Identifier
customObjectName - - Object name or ID
workflowAction - - Workflow action
workflowComments - - Workflow comments
userChoiceOwner - - Workflow Decision Maker, User Choice (user ID)
Returns:
Result - '0' for success and '-1' for failure and Actual Failures Message or Success Message available in Result.
Throws:
Exception

replaceTemplateVariables

public static String replaceTemplateVariables(String text,
                                              String objectId,
                                              String recordId)
                                       throws Exception
Throws:
Exception

replaceTemplateVariables

public static String replaceTemplateVariables(String text,
                                              String objectId,
                                              String recordId,
                                              TenantContext tenantContext)
                                       throws Exception
This method is used to mail merge using tenant context

Parameters:
text -
objectId -
recordId -
tenantContext -
Returns:
Throws:
Exception

changeOwnerShipInfo

public static Result changeOwnerShipInfo(String objectId,
                                         String recordId,
                                         String ownerId,
                                         boolean notifyOwner)
                                  throws Exception
This method does ownership change and sends notification email to the new owner

Parameters:
objectId -
recordId -
ownerId -
notifyOwner - should be true to get notification email
Returns:
Throws:
Exception

addFieldMetaData

public static String addFieldMetaData(FieldMetaDataBean fmdb)
                               throws Exception
This method return the meta data information of specified field of an object

Parameters:
fmdb -
Returns:
Throws:
Exception

getTaskOwner

public static String getTaskOwner(String processInstanceId,
                                  String taskDefKey)
                           throws Exception
Throws:
Exception

getTaskOwner

public static String getTaskOwner(String taskDefKey)
                           throws Exception
Throws:
Exception

getProcessVariable

public static Object getProcessVariable(String processInstanceId,
                                        String variableName)
                                 throws Exception
Throws:
Exception

getProcessVariable

public static Object getProcessVariable(String variableName)
                                 throws Exception
Throws:
Exception

setProcessVariable

public static void setProcessVariable(String processInstanceId,
                                      String variableName,
                                      Object value)
                               throws Exception
Throws:
Exception

setProcessVariable

public static void setProcessVariable(String variableName,
                                      Object value)
                               throws Exception
Throws:
Exception

updateFieldMetaData

public static String updateFieldMetaData(FieldMetaDataBean fmdb)
                                  throws Exception
This method return the meta data information of specified field of an object

Parameters:
fmdb -
Returns:
Throws:
Exception

deleteFieldMetaData

public static void deleteFieldMetaData(FieldMetaDataBean fmdb)
                                throws Exception
This method return the meta data information of specified field of an object

Parameters:
fmdb -
Throws:
Exception

getFieldMetaData

public static FieldMetaDataBean getFieldMetaData(String objectName,
                                                 String fieldName)
                                          throws Exception
This method return the meta data information of specified field of an object

Parameters:
objectName -
fieldName -
Returns:
Throws:
Exception

getFieldMetaData

public static FieldMetaDataBean getFieldMetaData(String objectName,
                                                 String fieldName,
                                                 TenantContext tenantContext)
                                          throws Exception
This method return the meta data information of specified field of an object

Parameters:
objectName -
fieldName -
Returns:
Throws:
Exception

getFieldMetaDataMap

public static Map getFieldMetaDataMap(String objectName)
                               throws Exception
This method returns the meta data information of all the fields of an object

Parameters:
objectName -
Returns:
Throws:
Exception

getIndexesMap

public static Map getIndexesMap(String objectName)
                         throws Exception
This method returns the list of indexes of specified object

Parameters:
objectName -
Returns:
Throws:
Exception

getIndex

public static IndexBean getIndex(String objectName,
                                 String indexName)
                          throws Exception
This method returns details of the index for specified object and specified index

Parameters:
objectName -
indexName -
Returns:
Throws:
Exception

addRecord

public static Result addRecord(String objectId,
                               Parameters params,
                               TenantContext tenantContext)
                        throws Exception
This method Adds a new record of type objectId with values from params in specified Tenant.

Parameters:
objectId - - Name or Id of the object that record to be added
params - - Record values
tenantContext - - TenantContext Object used to add record in specified tenant.
Returns:
Result - The record ID of the added record is available.
Throws:
Exception

updateRecord

public static Result updateRecord(String objectId,
                                  String id,
                                  Parameters params,
                                  TenantContext tenantContext)
                           throws Exception
This method Updates record of type objectId with values params in specified tenant. The Record is identified by recordId.

Parameters:
objectId - - Name or Id of the object that record to be updated
id - - Record ID
params - - Values of the record
tenantContext - - TenantContext Object used to update the record in specified tenant.
Returns:
Result - '0' for success and '-1' for failure and Actual Failures Message or Success Message available in Result.
Throws:
Exception

deleteRecord

public static Result deleteRecord(String objectId,
                                  String id,
                                  TenantContext tenantContext)
                           throws Exception
This Method deletes the specified Record in specified tenant

Parameters:
objectId - - Name or Id of the object that record to be deleted
id - - Record ID that needs to be deleted
tenantContext - - TenantContext Object used to delete record in specified tenant.
Returns:
Result - Result - '0' for success and '-1' for failure and Actual Failures Message or Success Message available in Result.
Throws:
Exception

getRecord

public static Result getRecord(String objectId,
                               String columns,
                               String recordId,
                               TenantContext tenantContext)
                        throws Exception
This method gets the record with specified fields for the specified Tenant

Parameters:
objectId - - Name or Id of the object
columns - - Field Names that needs to be fetched.
recordId - - Record ID
tenantContext - - TenantContext Object used to get record in specified tenant.
Returns:
Result - Result contains the Parameters Instance which contains the record values
Throws:
Exception

searchRecords

public static Result searchRecords(String objectId,
                                   String columns,
                                   String criteria,
                                   TenantContext tenantContext)
                            throws Exception
This method Search and retrieve the records for an object in specified Tenant

Parameters:
objectId - - Name or Id of the object
fields - - Field Names that needs to be fetched
criteria - - A filter expression that specifies records to select.
tenantContext - - TenantContext Object used to search record in specified tenant.
Returns:
Result contains the Parameters Instances which contains the records values.
Throws:
Exception

searchRecords

public static Result searchRecords(String objectId,
                                   String fields,
                                   String criteria,
                                   String sortBy,
                                   String sortOrder,
                                   String sortBy2,
                                   String sortOrder2,
                                   int offset,
                                   int numberOfRows,
                                   TenantContext tenantContext)
                            throws Exception
This method Search and retrieve the records for an object.

Parameters:
objectId - - Name or Id of the object
fields - - Field Names that needs to be fetched
criteria - - A filter expression that specifies records to select.
sortBy - - Sort the search results on the specified field.
sortOrder - - Specify if the sort order is ascending ("asc") or descending ("desc"). The default is ascending.
sortBy2 - - Do a secondary sort on the specified field.
sortOrder2 - - Specify if the sort order on the second level is ascending ("asc") or descending ("desc"). The default is ascending.
offset - - The maximum number of records that you can retrieve in a single call to searchRecords is 5,000. If you need to retrieve more than 5,000 records, you must set up a loop where you do paging by incrementing the offset parameter.
numberOfRows - - The maximum number of records to return
tenantContext - - TenantContext Object used to search records in specified tenant.
Returns:
- Result contains the Parameters Instances which contains the records values.
Throws:
Exception

getWorkflowActionList

public static Map getWorkflowActionList(String objectName,
                                        String recordId)
                                 throws Exception
This method return the list of workflow actions given objectName and recordId

Parameters:
objectName - - Name of the object
recordId - - Id of the record
Returns:
Map - list of workflow actions
Throws:
Exception

getTimezonesUtility

public static Map getTimezonesUtility()
                               throws Exception
This method return the list of time zones

Returns:
Map - List of time zones
Throws:
Exception

getTimezoneUtility

public static com.platform.beans.TimeZoneBean getTimezoneUtility(String timezoneId)
                                                          throws Exception
This method return time zone given time zone number

Parameters:
timezoneId - - Time zone number
Returns:
TimeZoneBean - Details of given time zone
Throws:
Exception

getObjectMetaData

public static CustomObjectMetaDataBean getObjectMetaData(String objectName)
                                                  throws Exception
This method returns the meta data information of specified object

Parameters:
objectName -
fieldName -
Returns:
Throws:
Exception

getObjectMetaDataMap

public static Map getObjectMetaDataMap()
                                throws Exception
This method returns the meta data information of all the objects available to user

Returns:
Throws:
Exception

addObjectMetaData

public static String addObjectMetaData(CustomObjectMetaDataBean omdb)
                                throws Exception
This method adds a particular object

Parameters:
omdb - - CustomObjectMetaDataBean
Returns:
Throws:
Exception

updateObjectMetaData

public static String updateObjectMetaData(CustomObjectMetaDataBean omdb)
                                   throws Exception
This method updates a particular object

Parameters:
omdb - - CustomObjectMetaDataBean
Returns:
Throws:
Exception

deleteObjectMetaData

public static void deleteObjectMetaData(CustomObjectMetaDataBean omdb)
                                 throws Exception
This method deletes a particular object

Parameters:
omdb - - CustomObjectMetaDataBean
Throws:
Exception

getRecordLocator

public static RecordLocatorBean getRecordLocator(String objectName)
                                          throws Exception
This method returns the record locator for a particular object

Parameters:
objectName -
Returns:
Throws:
Exception

updateRecordLocator

public static String updateRecordLocator(RecordLocatorBean rlb)
                                  throws Exception
This method updates the record locator of a particular object

Parameters:
rlb - - RecordLocatorBean
Returns:
Throws:
Exception

getLoggedInUserInfo

public static Map getLoggedInUserInfo()
                               throws Exception
This method gets a logged in user info

Parameters:
-
Returns:
Map containing user information
Throws:
Exception

proxyLogin

public static LoginResponseBean proxyLogin(String proxyUserId)
                                    throws Exception
proxy login to user with given userId

Parameters:
proxyUserId -
Returns:
Login info of proxy user
Throws:
Exception

getExecSQLFunctions

public static StringBuilder getExecSQLFunctions()

switchBack

public static LoginResponseBean switchBack()
                                    throws Exception
Switch back to original user if current user is proxy user

Returns:
login info of original user
Throws:
Exception

getRoleBean

public static RoleBean getRoleBean(String roleId)
                            throws Exception
returns role information based on role id

Returns:
Throws:
Exception

getAccessProfileBean

public static AccessProfileBean getAccessProfileBean(String accessProfileId)
                                              throws Exception
Parameters:
accessProfileId -
Returns:
Throws:
Exception

getGetWFOwnersFunction

@Deprecated
public static StringBuilder getGetWFOwnersFunction()
Deprecated. 

Get workflow owners list function as a string

Returns:

getWFOwners

@Deprecated
public static RecordBean getWFOwners(String objectId,
                                                String recordId)
                              throws Exception
Deprecated. 

Get workflow owners list

Parameters:
objectId -
recordId -
Returns:
Throws:
Exception

getWorkflowOwners

public static RecordBean getWorkflowOwners(String objectId,
                                           String recordId)
                                    throws Exception
Get the list of Workflow Owners given object Id and record Id

Parameters:
objectId - - Id of the object
recordId - - Id of the record
Returns:
RecordBean - Details of workflow owners of the record
Throws:
Exception

getRecordCount

public static int getRecordCount(String objectId,
                                 String criteria,
                                 TenantContext tenantContext)
                          throws Exception
This method returns the number of records and results depends on the criteria in a specified tenant

Parameters:
objectId - - Name or Id of the object.
criteria - - A filter expression that specifies records to select, where a field name of the form alias[.alias...].* or alias[.alias...].field indicates a Composite Object search.
tenantContext - - TenantContext Object used to get record count in specified tenancy.
Returns:
Result - An integer containing a count of records that match the selection criteria.
Throws:
Exception

getRecordCount

public static int getRecordCount(String objectId,
                                 String criteria)
                          throws Exception
This method returns the number of records in the objects and results depends on the criteria.

Parameters:
objectId - - Name or Id of the object.
criteria - - A filter expression that specifies records to select, where a field name of the form alias[.alias...].* or alias[.alias...].field indicates a Composite Object search.
Returns:
Result - An integer containing a count of records that match the selection criteria.
Throws:
Exception

schedule

public static String schedule(String jobName,
                              Schedulable schedulable,
                              String cronExp)
                       throws Exception
This method schedules a job

Parameters:
jobName - - User friendly job name
schedulable - - an instance of schedulable interface
cronExp - - cron expression specifies the job scheduling time
Throws:
Exception

schedule

public static String schedule(String jobName,
                              Schedulable schedulable,
                              String cronExp,
                              String userId)
                       throws Exception
Schedules and the job will be run with the specified user's permission

Parameters:
jobName -
schedulable -
cronExp -
userId - - user id
Returns:
Throws:
Exception

schedule

public static String schedule(String jobName,
                              Schedulable schedulable,
                              String cronExp,
                              String userId,
                              String endDate)
                       throws Exception
Parameters:
schedulable - Quartz job instance
cronExp - cron expression
jobName -
Returns:
Throws:
Exception

deleteJob

public static Result deleteJob(String jobId)
                        throws Exception
This method will be called when user requests for deleting the scheduled job

Parameters:
jobId - is the quartz job Name which is classId-jobId
Returns:
Throws:
Exception

addAuditLog

public static Result addAuditLog(String referenceId,
                                 String descriptionKey,
                                 String typeCode,
                                 String operationCode,
                                 String objectKey,
                                 String oldName,
                                 String newName,
                                 Parameters params)
                          throws Exception
Adding audit log entry

Parameters:
referenceId -
descriptionKey -
typeCode -
operationCode -
objectKey -
oldName -
newName -
params -
Returns:
Throws:
Exception

getStatus

public static StatusBean getStatus(String resourceName,
                                   String id)
                            throws Exception
Get status of the following operations: package deployment | import

Parameters:
resourceName -
id -
Returns:
Throws:
Exception

searchStatus

public static CollectionBean searchStatus(String resourceName,
                                          String fields,
                                          String criteria)
                                   throws Exception
Search status of the operation

Parameters:
resourceName -
criteria -
Returns:
Throws:
Exception

getRecord

public static Result getRecord(String objectId,
                               String columns,
                               String recordId,
                               Parameters scriptingParams)
                        throws Exception
This method gets the record with specified fields. This method is useful if user would like to fetch the update/delete permissions of the logged in user on getRecord, all these can be possible through the scriptingParams.

Parameters:
objectId - - Name or Id of the object
columns - - Field Names that needs to be fetched.
recordId - - Record ID
scriptingParams - - Instance of Parameters Object
Returns:
Result - Result contains the Parameters Instance which contains the record values
Throws:
Exception

getRecord

public static Result getRecord(String objectId,
                               String columns,
                               String recordId,
                               TenantContext tenantContext,
                               Parameters scriptingParams)
                        throws Exception
This method gets the record with specified fields for a specified Tenant. This method is useful if user would like to fetch the update/delete permissions of the logged in user on getRecord, all these can be possible through the scriptingParams.

Parameters:
objectId - - Name or Id of the object
columns - - Field Names that needs to be fetched.
recordId - - Record ID
tenantContext - - TenantContext Object used to add record in specified tenancy.
Returns:
Result - Result contains the Parameters Instance which contains the record values
Throws:
Exception

searchRecords

public static Result searchRecords(String objectId,
                                   String fields,
                                   String criteria,
                                   Parameters params)
                            throws Exception
This method Search and retrieve the records for an object. This method is useful if user would like to fetch the update/delete permissions of the logged in user on searchRecords, all these can be possible through the params.

Parameters:
objectId - - Name or Id of the object
fields - - Field Names that needs to be fetched
criteria - - A filter expression that specifies records to select.
params - - Instance of Parameters Object
Returns:
Result contains the Parameters Instances which contains the records values.
Throws:
Exception

searchRecords

public static Result searchRecords(String objectId,
                                   String fields,
                                   String criteria,
                                   String sortBy,
                                   String sortOrder,
                                   String sortBy2,
                                   String sortOrder2,
                                   int offset,
                                   int numberOfRows,
                                   Parameters params)
                            throws Exception
This method Search and retrieve the records for an object. This method is useful if user would like to fetch the update/delete permissions of the logged in user on searchRecords, all these can be possible through the params.

Parameters:
objectId - - Name or Id of the object
fields - - Field Names that needs to be fetched
criteria - - A filter expression that specifies records to select.
sortBy - - Sort the search results on the specified field.
sortOrder - - Specify if the sort order is ascending ("asc") or descending ("desc"). The default is ascending.
sortBy2 - - Do a secondary sort on the specified field.
sortOrder2 - - Specify if the sort order on the second level is ascending ("asc") or descending ("desc"). The default is ascending.
offset - - The maximum number of records that you can retrieve in a single call to searchRecords is 5,000. If you need to retrieve more than 5,000 records, you must set up a loop where you do paging by incrementing the offset parameter.
numberOfRows - - The maximum number of records to return
Returns:
- Result contains the Parameters Instances which contains the records values.
Throws:
Exception

searchRecords

public static Result searchRecords(String objectId,
                                   String columns,
                                   String criteria,
                                   TenantContext tenantContext,
                                   Parameters params)
                            throws Exception
This method Search and retrieve the records for an object in specified Tenant. This method is useful if user would like to fetch the update/delete permissions of the logged in user on searchRecords, all these can be possible through the params.

Parameters:
objectId - - Name or Id of the object
fields - - Field Names that needs to be fetched
criteria - - A filter expression that specifies records to select.
tenantContext - - TenantContext Object used to search record in specified tenancy.
params - - Instance of Parameters Object
Returns:
Result contains the Parameters Instances which contains the records values.
Throws:
Exception

searchRecords

public static Result searchRecords(String objectId,
                                   String fields,
                                   String criteria,
                                   String sortBy,
                                   String sortOrder,
                                   String sortBy2,
                                   String sortOrder2,
                                   int offset,
                                   int numberOfRows,
                                   TenantContext tenantContext,
                                   Parameters params)
                            throws Exception
This method Search and retrieve the records for an object for a specified Tenant. This method is useful if user would like to fetch the update/delete permissions of the logged in user on searchRecords, all these can be possible through the params.

Parameters:
objectId - - Name or Id of the object
fields - - Field Names that needs to be fetched
criteria - - A filter expression that specifies records to select.
sortBy - - Sort the search results on the specified field.
sortOrder - - Specify if the sort order is ascending ("asc") or descending ("desc"). The default is ascending.
sortBy2 - - Do a secondary sort on the specified field.
sortOrder2 - - Specify if the sort order on the second level is ascending ("asc") or descending ("desc"). The default is ascending.
offset - - The maximum number of records that you can retrieve in a single call to searchRecords is 5,000. If you need to retrieve more than 5,000 records, you must set up a loop where you do paging by incrementing the offset parameter.
numberOfRows - - The maximum number of records to return
tenantContext - - TenantContext Object used to search record in specified tenant.
params - - Instance of Parameters Object
Returns:
- Result contains the Parameters Instances which contains the records values.
Throws:
Exception

searchSocialFeeds

public static List searchSocialFeeds(SearchContext searchContext)
                              throws Exception
Get the list of Social Feeds

Parameters:
searchContext - - SearchContext
Returns:
List>
Throws:
Exception

addSocialFeed

public static String addSocialFeed(SocialFeedBean sfb)
                            throws Exception
Add Social Feed

Parameters:
sfb - - SocialFeedBean
Returns:
- Id of the feed added
Throws:
Exception

deleteSocialFeed

public static void deleteSocialFeed(String feedId)
                             throws Exception
Delete Social Feed

Parameters:
feedId - - Id of the Social Feed
Throws:
Exception

getSocialGroup

public static SocialGroupBean getSocialGroup(String groupId)
                                      throws Exception
Get Social Group

Parameters:
groupId - - Id of the group
Returns:
SocialGroupBean - Details of the group
Throws:
Exception

searchSocialGroups

public static List searchSocialGroups(SearchContext searchContext)
                               throws Exception
Get the list of Social Groups

Parameters:
searchContext - - SearchContext
Returns:
List>
Throws:
Exception

addSocialGroup

public static String addSocialGroup(SocialGroupBean sgb)
                             throws Exception
Add Social Group

Parameters:
sgb - - SocialGroupBean
Returns:
- Id of the group added
Throws:
Exception

updateSocialGroup

public static void updateSocialGroup(SocialGroupBean sgb,
                                     String groupId)
                              throws Exception
Update Social Group

Parameters:
sgb - - SocialGroupBean
groupId - - Id of the group
Throws:
Exception

deleteSocialGroup

public static void deleteSocialGroup(String groupId)
                              throws Exception
Delete Social Group

Parameters:
groupId - - Id of the group
Throws:
Exception

socialFollow

public static void socialFollow(SocialBean socialBean)
                         throws PlatformException,
                                Exception
Social Follow a resource

Parameters:
socialBean - - Details of the resource
Throws:
PlatformException
Exception

socialUnfollow

public static void socialUnfollow(SocialBean socialBean)
                           throws PlatformException,
                                  Exception
Social Unfollow a resource

Parameters:
socialBean - - Details of the resource
Throws:
PlatformException
Exception

getSocialFollowers

public static CollectionBean getSocialFollowers(String type,
                                                String id,
                                                String objectId,
                                                String filter)
                                         throws Exception
Get the list of Followers for a resource

Parameters:
type - - Social Resource Type
id - - Id of the resource
objectId - - Id of the object
filter - - Criteria
Returns:
CollectionBean - list of followers
Throws:
Exception

getSocialFollowing

public static CollectionBean getSocialFollowing(String userId,
                                                String filter)
                                         throws Exception
Get list of what is user following

Parameters:
userId - - Id of the user
filter - - criteria
Returns:
CollectionBean - List of resources user is following
Throws:
Exception

getSocialNotificationsList

public static List getSocialNotificationsList(boolean newOnly)
                                       throws Exception
Get list of notifications

Parameters:
show_new - - optional parameter
Returns:
CollectionBean
Throws:
Exception

getSocialNotificationsCount

public static int getSocialNotificationsCount()
                                       throws Exception
Get new notifications count

Returns:
CollectionBean
Throws:
Exception

setAllSocialNotificationsRead

public static void setAllSocialNotificationsRead()
                                          throws Exception
Sets all notifications read

Throws:
Exception

getSocialFeed

public static SocialFeedBean getSocialFeed(String id)
                                    throws Exception
Get feed posting

Parameters:
id - - posting id
Returns:
BaseBean
Throws:
Exception

getSocialVotes

public static CollectionBean getSocialVotes(String id,
                                            String action,
                                            String filter)
                                     throws Exception
Get the list of votes for specified resource and action

Parameters:
id - - Id of the resource
action - - action (like/etc.)
filter - - Criteria
Returns:
CollectionBean - list of followers
Throws:
Exception

socialVote

public static void socialVote(String id,
                              String action)
                       throws PlatformException,
                              Exception
Vote a resource

Parameters:
id - - id of the resource
action - - action (like/etc)
Throws:
PlatformException
Exception

importData

public static String importData(String objectName,
                                String mappingProfile,
                                PlatformFileBean fileBean)
                         throws Exception
Parameters:
fileBean - - PlatformFileBean
ObjectId -
mappingProfile - - name of the mapping profile
Returns:
Throws:
Exception

getMappingProfiles

public static HashMap getMappingProfiles(String objectName)
                                  throws Exception
gets the list of mapping profiles for the specified object

Parameters:
objectId -
Returns:
Throws:
Exception

getGlobalPicklist

public static GlobalPicklistBean getGlobalPicklist(String id)
                                            throws Exception
Get Global Picklist

Parameters:
id -
Returns:
Throws:
Exception

addGlobalPicklist

public static String addGlobalPicklist(GlobalPicklistBean bean)
                                throws Exception
Add Global Picklist

Parameters:
id -
Returns:
Throws:
Exception

updateGlobalPicklist

public static String updateGlobalPicklist(GlobalPicklistBean bean,
                                          String id)
                                   throws Exception
Update Global Picklist

Parameters:
id -
Returns:
Throws:
Exception

deleteGlobalPicklist

public static void deleteGlobalPicklist(String id)
                                 throws Exception
Delete Global Picklist

Parameters:
id -
Throws:
Exception

searchGlobalPicklists

public static List searchGlobalPicklists(SearchContext searchContext)
                                  throws Exception
Search Global Picklist

Parameters:
id -
Returns:
Throws:
Exception

getMaxStatementCounterLimit

public static long getMaxStatementCounterLimit()
This method is used to get Maximum Statement counter that is defined in Service Configurations. This is the Governance Limit for total statments that can be executed in single request.


getCurrentStatmentCount

public static long getCurrentStatmentCount()
This method is used to get the current Statmement counter. This is used to know the number of statements that already been executed in a single request.


getMaxStringSizeLimit

public static long getMaxStringSizeLimit()
This method is used to get Maximum String size limit that is defined in Service Configurations. This is the Governance Limit for total length of the String that can be executed in single request.


getCurrentStringSize

public static long getCurrentStringSize()
This method is used to get the current String size. This is used to know the length of the String that already been used in a single request.


getMaxCPUTimeLimit

public static long getMaxCPUTimeLimit()
This method is used to get Maximum CPU Time that is defined in Service Configurations. This is the Governance Limit for Maximum CPU Time that a single request can take.


getCurrentCPUTime

public static long getCurrentCPUTime()
This method is used to get the current CPU Time. This is used to know the number of milliseconds that a single request already been used.


createUserRequestContext

public static void createUserRequestContext(Thread thread)
                                     throws Exception
Parameters:
thread -
Throws:
Exception

clearUserRequestContext

public static void clearUserRequestContext(Thread thread)
                                    throws Exception
Parameters:
thread -
Throws:
Exception

sleep

public static void sleep(long milliseconds)
                  throws InterruptedException
Performs Thread.sleep();

Parameters:
milliseconds - sleep time in milliseconds
Throws:
InterruptedException

execSQL

public static Result execSQL(String sql)
                      throws Exception
Throws:
Exception


Copyright and Legal Notices