Medium
Create a replacing view model schema of the project page
- Go to the Configuration section and select a custom package to add the schema.
-
Click Add → Replacing view model on the section list toolbar.
-
Fill out the schema properties.
- Set Code to "ProjectPageV2."
- Set Title to "Project edit page."
- Select "ProjectPageV2" in the Parent object property.
-
Set up the field population logic.
To do this, implement the following methods in the methods property:
- onEntityInitialized(). An overloaded base virtual method. Called after Creatio initializes the object schema. Call the setDeadline() handler method in the onEntityInitialized() method. The handler method ensures the Deadline field value is set when a record page opens.
- setDeadline(). The handler method that calculates the Deadline field value.
View the source code of the replacing view model schema of the project page below.
- Click Save on the Designer's toolbar.
Outcome of the example
To view the outcome of the example, refresh the Projects section page.
As a result, Creatio will set the date value of the Deadline field that is 10 days later than the Start date on the page that adds a project.
Resources