public class Functions extends Object
Modifier and Type | Field and Description |
---|---|
static String |
__JAVA_API_SHOW_MESSAGE__ |
static String |
__SQL_STR__ |
static Map |
customers |
static String |
DEBUG_MESSAGES_LIST |
static String |
SAVEPOINTMAPKEY |
static String |
SCRIPT_EXECUTION_STACK_KEY |
Constructor and Description |
---|
Functions() |
Modifier and Type | Method and Description |
---|---|
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)
Deprecated.
Use addRecord("tasks",...) instead.
|
static Result |
addTask(String subject,
Date dueDate,
String ownerId,
Parameters params)
Deprecated.
Use addRecord("tasks",...) instead.
|
static Result |
addToRecordForImport(HashMap paramsToRecord) |
static Result |
assignToTeam(String objectId,
String recordId,
String teamId)
This method does ownership change to team
|
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 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)
Deprecated.
Use deleteRecord("tasks",...) instead.
|
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 String |
formatCurrency(String value,
int precision)
This method formats a numeric value using the company's locale setting for currencies.
|
static String |
formatDate(Date value)
This method formats a date in the user's locale.
|
static String |
formatDateTime(Date value)
This method formats a date and time in the user's locale.
|
static String |
formatNumber(String value,
int precision)
This method formats an integer or double using the user's locale.
|
static String |
formatPercent(String value,
int precision)
This method formats a percent value using the user's locale.
|
static String |
formatTime(Date value)
This method formats a time in the user's locale.
|
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 Result |
getDocument(String documentId)
This method returns the document for the specified document id.
|
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 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 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 String |
parseCurrency(String value)
This method parses a value using the company's locale setting for currencies.
|
static String |
parseNumber(String value)
This method parses an integer or double value using the user's current locale.
|
static String |
parsePercent(String value)
This method parses a percentage value using the user's current locale.
|
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 Email.
|
static Result |
sendEmail(String objectId,
String id,
String to,
String cc,
String bcc,
String subject,
String body,
String attachmentTemplateId,
String attachmentIdList)
This method sends an Email.
|
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 Email 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 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 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, 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)
Deprecated.
- Use updateRecord("tasks",...) instead.
|
static boolean |
validateCurrency(String value)
This method validates a currency value using the company's locale setting for currencies.
|
static boolean |
validateNumber(String value)
This method validates an integer or double value using the user's current locale.
|
static boolean |
validatePercent(String value)
This method validates a percentage value using the user's current locale.
|
public static String SCRIPT_EXECUTION_STACK_KEY
public static String DEBUG_MESSAGES_LIST
public static String SAVEPOINTMAPKEY
public static String __SQL_STR__
public static final String __JAVA_API_SHOW_MESSAGE__
public static Map customers
public static void throwError(String messageStr) throws Exception
messageStr
- - Error MessageException
public static void throwError(String key, String[] args, boolean flag) throws Exception
key
- Custom Label defined in Translation Workbenchargs
- Runtime Arguments required for the specified Custom Labelflag
- boolean value determines whether to process the arguments or not, if false, this method throws what ever exists in key as error messageException
public static String translateToken(String key) throws Exception
key
- - Custom Label defined in Translation WorkbenchException
public static String translateToken(String key, String[] args) throws Exception
key
- - Custom Label defined in Translation Workbenchargs
- - Runtime Arguments required for the specified Custom LabelException
public static String globalTranslateToken(String key) throws Exception
key
- - Custom Label defined in Translation WorkbenchException
public static String globalTranslateToken(String key, String[] args) throws Exception
key
- - Custom Label defined in Translation Workbench of Global Tenantargs
- - Runtime Arguments required for the specified Custom LabelException
public static Result addRecord(String objectId, Parameters params) throws Exception
objectId
- - Name or Id of the object that record to be addedparams
- - Record valuesException
public static Result updateRecord(String objectId, String id, Parameters params) throws Exception
objectId
- - Name or Id of the object that record to be updatedid
- - Record IDparams
- - Values of the recordException
public static Result deleteRecord(String objectId, String id) throws Exception
objectId
- - Name or Id of the object that record to be deletedid
- - Record ID that needs to be deletedException
public static Result deleteRecord(String objectId, String id, Parameters params) throws Exception
objectId
- - Name or Id of the object that record to be addedid
- - Record ID that needs to be deletedparams
- - Instance of Parameters objectException
public static Result getRecord(String objectId, String columns, String recordId) throws Exception
objectId
- - Name or Id of the objectcolumns
- - Field Names that needs to be fetched.recordId
- - Record IDException
public static Result searchRecords(String objectId, String fields, String criteria) throws Exception
objectId
- - Name or Id of the objectfields
- - Field Names that needs to be fetchedcriteria
- - A filter expression that specifies records to select.Exception
public static Result searchRecords(String objectId, String fields, String criteria, String sortBy, String sortOrder, String sortBy2, String sortOrder2, int offset, int numberOfRows) throws Exception
objectId
- - Name or Id of the objectfields
- - Field Names that needs to be fetchedcriteria
- - 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 returnException
public static Result searchRecords(SearchContext searchContext) throws Exception
searchContext
- Exception
public static Result sendEmailUsingTemplate(String objectId, String id, String to, String cc, String subject, String bodyTemplateId, String attachmentTemplateId, String attachmentIdList) throws Exception
objectId
- - Name or Id of the objectid
- - Record Idto
- - A list of comma-separated email addressescc
- - A list of comma-separated email addressessubject
- - A descriptive text stringbodyTemplateId
- - 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 to include as attachments.Exception
public static Result sendEmailUsingTemplate(String objectId, String id, String to, String cc, String bcc, String subject, String bodyTemplateId, String attachmentTemplateId, String attachmentIdList) throws Exception
objectId
- - Name or Id of the objectid
- - Record Idto
- - A list of comma-separated email addressescc
- - A list of comma-separated email addressesbcc
- - A list of comma-separated email addressessubject
- - A descriptive text stringbodyTemplateId
- - 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 to include as attachments.Exception
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
objectId
- - Name or Id of the objectid
- - Record Idto
- - A list of comma-separated email addressescc
- - A list of comma-separated email addressesbcc
- - A list of comma-separated email addressessubject
- - A descriptive text stringbodyTemplateId
- - 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 to include as attachments.fromName
- sender namefromAddress
- sender addressException
public static Result sendEmail(String objectId, String id, String to, String cc, String subject, String body, String attachmentTemplateId, String attachmentIdList) throws Exception
objectId
- - Name or Id of the object.id
- - Record IDto
- - A list of comma-separated email addressescc
- - A list of comma separated email addressessubject
- - A descriptive text stringbody
- - 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 attachmentsattachmentIdList
- - A list of comma-separated document identifiers to include as attachments.Exception
public static Result sendEmail(String objectId, String id, String to, String cc, String subject, String body, String attachmentTemplateId, String attachmentIdList, TenantContext tenantContext) throws Exception
objectId
- - Name or Id of the object.id
- - Record IDto
- - A list of comma-separated email addressescc
- - A list of comma separated email addressessubject
- - A descriptive text stringbody
- - 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 attachmentsattachmentIdList
- - A list of comma-separated document identifiers to include as attachments.tenantContext
- - TenantContext Object used to send an email using a user-alias in another tenancy.Exception
public static Result sendEmail(String objectId, String id, String to, String cc, String bcc, String subject, String body, String attachmentTemplateId, String attachmentIdList) throws Exception
objectId
- - Name or Id of the object.id
- - Record IDto
- - A list of comma-separated email addressescc
- - A list of comma separated email addressesbcc
- - A list of comma separated email addressessubject
- - A descriptive text stringbody
- - 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 attachmentsattachmentIdList
- - A list of comma-separated document identifiers to include as attachments.Exception
public static Result generateDocument(String objectId, String id, String templateId, String format) throws Exception
objectId
- - Name or Id of the object.id
- - Record IDtemplateId
- - The name of the print templateformat
- - Format that can be either CONSTANT.DOCUMENT.FORMAT.HTML or CONSTANT.DOCUMENT.FORMAT.PDFException
public static Result addTask(String subject, Date dueDate, String ownerId) throws Exception
subject
- - The subject of the taskdueDate
- - The date the task is dueownerId
- - The identifier of the ownerException
public static Result addTask(String subject, Date dueDate, String ownerId, Parameters params) throws Exception
subject
- - The subject of the taskdueDate
- - The date the task is dueownerId
- - The identifier of the ownerparams
- - Other task field-value pairsException
public static Result updateTask(String taskId, Parameters params) throws Exception
taskId
- - Record ID of the TASKparams
- - Field-value pairs to update in the taskException
public static Result deleteTask(String record_id) throws Exception
record_id
- - Record ID of the TASKException
public static Result addEvent(String subject, String ownerID, Date startDate, int hour, int min, int duration) throws Exception
subject
- - The subject of the eventownerID
- - The identifier of the owner of the eventstartDate
- - The start date of the eventhour
- - The start hour of the eventmin
- - The start minute of the eventduration
- - The length of the eventException
public static Result addEvent(String subject, String ownerID, Date startDate, int hour, int min, int duration, Parameters params) throws Exception
subject
- - The subject of the eventownerID
- - The identifier of the owner of the eventstartDate
- - The start date of the eventhour
- - The start hour of the eventmin
- - The start minute of the eventduration
- - The length of the eventparams
- - Other field-value pairs for the eventException
public static Result logActivity(String subject, String objectId, String id, String activityByID, Parameters params) throws Exception
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 fieldobjectId
- - Name or Id of the object.id
- - Record IDactivityByID
- - User identifier; The name of the user who has performed this activityparams
- - Other field-value pairs for the activityException
public static Result updateEvent(String eventId, Parameters params) throws Exception
eventId
- - Record ID of the Eventparams
- - Field-value pairs to update in the eventException
public static Result deleteEvent(String eventId) throws Exception
eventId
- - Record ID of the EVENTException
public static String getEnv(String key) throws Exception
key
- - key to access the environment variables like ENV.USER.ID, ENV.USER.EMAIL ..etc.Exception
public static Parameters getParametersInstance() throws Exception
Exception
public static Object exec(String functionName, Parameters params) throws Exception
functionName
- - Name of the function that needs to be executed.params
- - Instance of the Parmeters which contains key-value pairs.Exception
public static Result addToRecordForImport(HashMap paramsToRecord) throws Exception
Exception
public static Result removeFromRecordForImport(HashMap paramsToRecord) throws Exception
Exception
public static void addSavePoint(String name) throws Exception
name
- - SavePoint NameException
public static void rollbackToSavePoint(String name) throws Exception
name
- - SavePoint NameException
public static void removeSavePoint(String name) throws Exception
name
- - SavaPoint NameException
public static boolean doesSavePointExist(String name) throws Exception
name
- - SavePoint NameException
public static Set getAllSavePoints() throws Exception
Exception
public static void rollback() throws Exception
Exception
public static void showMessage(String customMessage) throws Exception
customMessage
- - Custom Message that needs to displayed.Exception
public static void showMessage(String key, String[] args) throws Exception
key
- - Key for the custom messageargs
- - Runtime arguments that will be displayed along with message.Exception
public static void setTargetPage(String url) throws Exception
url
- - URL is the relative pathException
public static String replaceTemplateVariables(String text, String objectId, String recordId) throws Exception
Exception
public static String replaceTemplateVariables(String text, String objectId, String recordId, TenantContext tenantContext) throws Exception
text
- objectId
- recordId
- tenantContext
- Exception
public static Result changeOwnerShipInfo(String objectId, String recordId, String ownerId, boolean notifyOwner) throws Exception
objectId
- recordId
- ownerId
- notifyOwner
- should be true to get notification emailException
public static String addFieldMetaData(FieldMetaDataBean fmdb) throws Exception
fmdb
- Exception
public static String getTaskOwner(String processInstanceId, String taskDefKey) throws Exception
Exception
public static String getTaskOwner(String taskDefKey) throws Exception
Exception
public static Object getProcessVariable(String processInstanceId, String variableName) throws Exception
Exception
public static Object getProcessVariable(String variableName) throws Exception
Exception
public static void setProcessVariable(String processInstanceId, String variableName, Object value) throws Exception
Exception
public static void setProcessVariable(String variableName, Object value) throws Exception
Exception
public static String updateFieldMetaData(FieldMetaDataBean fmdb) throws Exception
fmdb
- Exception
public static void deleteFieldMetaData(FieldMetaDataBean fmdb) throws Exception
fmdb
- Exception
public static FieldMetaDataBean getFieldMetaData(String objectName, String fieldName) throws Exception
objectName
- fieldName
- Exception
public static FieldMetaDataBean getFieldMetaData(String objectName, String fieldName, TenantContext tenantContext) throws Exception
objectName
- fieldName
- Exception
public static Map getFieldMetaDataMap(String objectName) throws Exception
objectName
- Exception
public static Map getIndexesMap(String objectName) throws Exception
objectName
- Exception
public static IndexBean getIndex(String objectName, String indexName) throws Exception
objectName
- indexName
- Exception
public static Result addRecord(String objectId, Parameters params, TenantContext tenantContext) throws Exception
objectId
- - Name or Id of the object to add the record toparams
- - Record valuestenantContext
- - TenantContext Object used to add record in specified tenant.Exception
public static Result updateRecord(String objectId, String id, Parameters params, TenantContext tenantContext) throws Exception
objectId
- - Name or Id of the object that record to be updatedid
- - Record IDparams
- - Values of the recordtenantContext
- - TenantContext Object used to update the record in specified tenant.Exception
public static Result deleteRecord(String objectId, String id, TenantContext tenantContext) throws Exception
objectId
- - Name or Id of the object that record to be deletedid
- - Record ID that needs to be deletedtenantContext
- - TenantContext Object used to delete record in specified tenant.Exception
public static Result getRecord(String objectId, String columns, String recordId, TenantContext tenantContext) throws Exception
objectId
- - Name or Id of the objectcolumns
- - Field Names that needs to be fetched.recordId
- - Record IDtenantContext
- - TenantContext Object used to get record in specified tenant.Exception
public static Result searchRecords(String objectId, String columns, String criteria, TenantContext tenantContext) throws Exception
objectId
- - Name or Id of the objectfields
- - Field Names that needs to be fetchedcriteria
- - A filter expression that specifies records to select.tenantContext
- - TenantContext Object used to search record in specified tenant.Exception
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
objectId
- - Name or Id of the objectfields
- - Field Names that needs to be fetchedcriteria
- - 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 returntenantContext
- - TenantContext Object used to search records in specified tenant.Exception
public static Map getTimezonesUtility() throws Exception
Exception
public static com.platform.beans.TimeZoneBean getTimezoneUtility(String timezoneId) throws Exception
timezoneId
- - Time zone numberException
public static CustomObjectMetaDataBean getObjectMetaData(String objectName) throws Exception
objectName
- fieldName
- Exception
public static Map getObjectMetaDataMap() throws Exception
Exception
public static String addObjectMetaData(CustomObjectMetaDataBean omdb) throws Exception
omdb
- - CustomObjectMetaDataBeanException
public static String updateObjectMetaData(CustomObjectMetaDataBean omdb) throws Exception
omdb
- - CustomObjectMetaDataBeanException
public static void deleteObjectMetaData(CustomObjectMetaDataBean omdb) throws Exception
omdb
- - CustomObjectMetaDataBeanException
public static RecordLocatorBean getRecordLocator(String objectName) throws Exception
objectName
- Exception
public static String updateRecordLocator(RecordLocatorBean rlb) throws Exception
rlb
- - RecordLocatorBeanException
public static Map getLoggedInUserInfo() throws Exception
- Exception
public static LoginResponseBean proxyLogin(String proxyUserId) throws Exception
proxyUserId
- Exception
public static StringBuilder getExecSQLFunctions()
public static LoginResponseBean switchBack() throws Exception
Exception
public static RoleBean getRoleBean(String roleId) throws Exception
Exception
public static AccessProfileBean getAccessProfileBean(String accessProfileId) throws Exception
accessProfileId
- Exception
public static int getRecordCount(String objectId, String criteria, TenantContext tenantContext) throws Exception
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.Exception
public static int getRecordCount(String objectId, String criteria) throws Exception
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.Exception
public static String schedule(String jobName, Schedulable schedulable, String cronExp) throws Exception
jobName
- - User friendly job nameschedulable
- - an instance of schedulable interfacecronExp
- - cron expression specifies the job scheduling timeException
public static String schedule(String jobName, Schedulable schedulable, String cronExp, String userId) throws Exception
jobName
- schedulable
- cronExp
- userId
- - user idException
public static String schedule(String jobName, Schedulable schedulable, String cronExp, String userId, String endDate) throws Exception
schedulable
- Quartz job instancecronExp
- cron expressionjobName
- Exception
public static Result deleteJob(String jobId) throws Exception
jobId
- is the quartz job Name which is classId-jobIdException
public static Result addAuditLog(String referenceId, String descriptionKey, String typeCode, String operationCode, String objectKey, String oldName, String newName, Parameters params) throws Exception
referenceId
- descriptionKey
- typeCode
- operationCode
- objectKey
- oldName
- newName
- params
- Exception
public static StatusBean getStatus(String resourceName, String id) throws Exception
resourceName
- id
- Exception
public static CollectionBean searchStatus(String resourceName, String fields, String criteria) throws Exception
resourceName
- criteria
- Exception
public static Result getRecord(String objectId, String columns, String recordId, Parameters scriptingParams) throws Exception
objectId
- - Name or Id of the objectcolumns
- - Field Names that needs to be fetched.recordId
- - Record IDscriptingParams
- - Instance of Parameters ObjectException
public static Result getRecord(String objectId, String columns, String recordId, TenantContext tenantContext, Parameters scriptingParams) throws Exception
objectId
- - Name or Id of the objectcolumns
- - Field Names that needs to be fetched.recordId
- - Record IDtenantContext
- - TenantContext Object used to add record in specified tenancy.Exception
public static Result searchRecords(String objectId, String fields, String criteria, Parameters params) throws Exception
objectId
- - Name or Id of the objectfields
- - Field Names that needs to be fetchedcriteria
- - A filter expression that specifies records to select.params
- - Instance of Parameters ObjectException
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
objectId
- - Name or Id of the objectfields
- - Field Names that needs to be fetchedcriteria
- - 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 returnException
public static Result searchRecords(String objectId, String columns, String criteria, TenantContext tenantContext, Parameters params) throws Exception
objectId
- - Name or Id of the objectfields
- - Field Names that needs to be fetchedcriteria
- - A filter expression that specifies records to select.tenantContext
- - TenantContext Object used to search record in specified tenancy.params
- - Instance of Parameters ObjectException
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
objectId
- - Name or Id of the objectfields
- - Field Names that needs to be fetchedcriteria
- - 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 returntenantContext
- - TenantContext Object used to search record in specified tenant.params
- - Instance of Parameters ObjectException
public static List searchSocialFeeds(SearchContext searchContext) throws Exception
searchContext
- - SearchContextException
public static String addSocialFeed(SocialFeedBean sfb) throws Exception
sfb
- - SocialFeedBeanException
public static void deleteSocialFeed(String feedId) throws Exception
feedId
- - Id of the Social FeedException
public static SocialGroupBean getSocialGroup(String groupId) throws Exception
groupId
- - Id of the groupException
public static List searchSocialGroups(SearchContext searchContext) throws Exception
searchContext
- - SearchContextException
public static String addSocialGroup(SocialGroupBean sgb) throws Exception
sgb
- - SocialGroupBeanException
public static void updateSocialGroup(SocialGroupBean sgb, String groupId) throws Exception
sgb
- - SocialGroupBeangroupId
- - Id of the groupException
public static void deleteSocialGroup(String groupId) throws Exception
groupId
- - Id of the groupException
public static void socialFollow(SocialBean socialBean) throws PlatformException, Exception
socialBean
- - Details of the resourcePlatformException
Exception
public static void socialUnfollow(SocialBean socialBean) throws PlatformException, Exception
socialBean
- - Details of the resourcePlatformException
Exception
public static CollectionBean getSocialFollowers(String type, String id, String objectId, String filter) throws Exception
type
- - Social Resource Typeid
- - Id of the resourceobjectId
- - Id of the objectfilter
- - CriteriaException
public static CollectionBean getSocialFollowing(String userId, String filter) throws Exception
userId
- - Id of the userfilter
- - criteriaException
public static List getSocialNotificationsList(boolean newOnly) throws Exception
show_new
- - optional parameterException
public static int getSocialNotificationsCount() throws Exception
Exception
public static void setAllSocialNotificationsRead() throws Exception
Exception
public static SocialFeedBean getSocialFeed(String id) throws Exception
id
- - posting idException
public static CollectionBean getSocialVotes(String id, String action, String filter) throws Exception
id
- - Id of the resourceaction
- - action (like/etc.)filter
- - CriteriaException
public static void socialVote(String id, String action) throws PlatformException, Exception
id
- - id of the resourceaction
- - action (like/etc)PlatformException
Exception
public static String importData(String objectName, String mappingProfile, PlatformFileBean fileBean) throws Exception
fileBean
- - PlatformFileBeanObjectId
- mappingProfile
- - name of the mapping profileException
public static HashMap getMappingProfiles(String objectName) throws Exception
objectId
- Exception
public static GlobalPicklistBean getGlobalPicklist(String id) throws Exception
id
- Exception
public static String addGlobalPicklist(GlobalPicklistBean bean) throws Exception
id
- Exception
public static String updateGlobalPicklist(GlobalPicklistBean bean, String id) throws Exception
id
- Exception
public static void deleteGlobalPicklist(String id) throws Exception
id
- Exception
public static List searchGlobalPicklists(SearchContext searchContext) throws Exception
id
- Exception
public static long getMaxStatementCounterLimit()
public static long getCurrentStatmentCount()
public static long getMaxStringSizeLimit()
public static long getCurrentStringSize()
public static long getMaxCPUTimeLimit()
public static long getCurrentCPUTime()
public static void createUserRequestContext(Thread thread) throws Exception
thread
- Exception
public static void clearUserRequestContext(Thread thread) throws Exception
thread
- Exception
public static void sleep(long milliseconds) throws InterruptedException
milliseconds
- sleep time in millisecondsInterruptedException
public static Result getDocument(String documentId)
It returns a Result object, which contains the document in the form of a PlatformFile Bean.
1. Use the getParameters() method to get the params from the Result object.
2. Use getPlatformFileBean(), passing the document ID as a string.
3. Use getBytes() on the PlatformFileBean to get document content in a byte[].
Result result = getDocument(documentId); Parameters params = result.getParameters(); PlatformFileBean file = params.getPlatformFileBean(documentId); byte[] bytes = file.getBytes(); String msg = "Name:"+file.getName()+", size:"+file.getEncodedFileContent().length(); Logger.info(msg, "Document");
documentId
- public static String formatCurrency(String value, int precision)
If the input value is not in the expected format, it is returned unchanged. (The function is intended for use when formatting platform data for display to a user.)
value
- A String containing a numeric value
with no currency character, no group separators (commas),
and with a decimal point for the fractional amount.precision
- The number of decimal places to display in the result.public static String formatNumber(String value, int precision)
If the input value is not in the expected format, it is returned unchanged. (The function is intended for use when formatting platform data for display to a user.)
value
- A String containing a numeric value with
no group separators (commas), and with a decimal point for any fractional amount.precision
- The number of decimal places to include in the result.
(For an integer value, precision should be 0.)public static String formatPercent(String value, int precision)
If the input value is not in the expected format, it is returned unchanged. (The function is intended for use when formatting platform data for display to a user.)
value
- A String containing a numeric value
with no percent character, no group separators (commas),
and with a decimal point for the fractional amount.precision
- The number of decimal places to include in the result.public static String formatDateTime(Date value)
value
- A Date Objectpublic static String formatTime(Date value)
value
- A Date Objectpublic static String formatDate(Date value)
value
- A Date Objectpublic static String parseCurrency(String value)
If the value fails to parse, the original value is returned. (Developers are therefore encouraged to use the validateCurrency() method before parsing.)
value
- A currency amount formatted according to the company's locale.Exception
- if the value does not parse correctly for the localepublic static String parseNumber(String value)
If the value fails to parse, the original value is returned. (Developers are therefore encouraged to use the validateNumber() method before parsing.)
value
- A numeric value, formatted according the user's locale.public static String parsePercent(String value)
If the value fails to parse, the original value is returned. (Developers are therefore encouraged to use the validatePercent() method before parsing.)
value
- A percentage value, formatted according the user's locale.public static boolean validateCurrency(String value)
value
- A currency value, formatted according to the company's locale setting.public static boolean validateNumber(String value)
value
- A numeric value, formatted according to the user's locale.public static boolean validatePercent(String value)
value
- A percentage value, formatted according to the user's locale.