Have you built any parent-child or sibling relationships yet in Onit? If so, great! This tutorial will expand your skill set in this area. If not, however, this tutorial might not make a lot of sense -- we suggest taking a look at Creating a Sibling Relationship and Creating a Parent-Child Relationship first.
You can configure a Create Related Button so users can easily launch a new related transaction directly from a transaction's View Page. Any Fields in the related apps that share the same Name will be automatically populated with the transaction data from which the new transaction is being launched.
You can set up a Create Related Button for either or both apps in a sibling relationship. However, a Create Related Button can only be configured for the parent app's View Pages in a parent-child relationship. Child transactions can only have a single parent transaction; consequently, you cannot configure a Create Related Button to launch new parent transactions from a child app's View Pages.
Before We Start...
This tutorial will assume you understand the following concepts:
Let's Get Started!
In this tutorial, we'll configure a Create Related Button for the View Page of a Legal Matters app that launches a new transaction in one of its child apps, Tasks.
1. Add a New Create Related Button
Start by visiting the Advanced Designer of the App you want to launch related Records from. For us, that's our Legal Matters App.
Navigate to the Buttons node from the left-hand pane.
Select Create Related from the Add dropdown.
2. Configure the Create Related Button
Provide your new Button with a Name and a Display Name. (These can be the same.) We'll name our Button Create Task.
Select the Field that draws the relationship between your two apps for the Related Atom Field property. For us, that's a HasMany Field named tasks.
Tip: As with all Buttons, you can optionally provide a Condition to set when the Create Related Button will display. This can control whether the Button is available to certain users or role types.
If you need help building a Condition, see our Creating a Condition tutorial.
Your Related Atom Field must be a HasMany or ManyToMany. If you try to use the button with a BelongsTo Field, it won't work and will throw an error.
Select OK to save your new Button.
Test It Out!
That's all there is to it. Hop over to one of the transactions for which you configured the Button in the app. Your Create Related Button should appear along with the other transaction Buttons on the right-hand side of the View Page.
Select your new Button, and a Launch Page will open to create a new transaction in your related app.
Notice that in the example below, we've automatically populated Field values by configuring our Tasks app with Fields that match the parent app's Matter Name and Matter Description Fields.