Skip to main content
Mitratech Success Center

Client Support Center

Need help? Click a product group below to select your application and get access to knowledge articles, webinars, training content, and release notes or to contact our support team.

Authorized users - log in to create a ticket, view tickets status and check your success plan details.

 

Creating New Records

Specific conditions frequently require the creation of new records. For example, a business rule may require that when a value changes in a project, the rule automated action to create a new history record.

You can use the following methods to create new records:

  • The new<Object>() methods in the resource service classes to create new objects. For example, newExpense() in ExpenseService.

    Note: When writing code to create a new record for a rule, you do not need to use the create() method because the rule automatically commits the changes to the database.
     
  • The ResourceService.create() method to save the created object to the database after you create the empty object.
  • Object-specific methods that you can set in the new empty object using the API model interfaces for the objects.
  • The UtilityService.runAsSystemUser() method to create the record regardless of the current user's rights. For more details, see Running Code as the System User.

In addition to the resource service samples, refer to Creating a History RecordCreating a Child Project, and Creating Related Task Record for more samples about creating a record in Java.

  • Was this article helpful?