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 data of the transaction the new transaction is being launched from.
You can set up a Create Related Button for either or both apps in a sibling relationship. However, in a parent-child relationship, a Create Related Button can only be configured for the parent app's View Pages. 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...
Let's Get Started!
In this tutorial, we'll configure a Create Related Button for the View Page of a Legal Matters app that will launch a new transaction in one of its child apps named 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.
For the Related Atom Field property, select the Field that draws the relationship between your two apps. 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 be used to control whether the Button is available for use 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 in the app you configured the Button for. Your Create Related Button should appear along wth the other transaction Buttons on the right-hand side of the View Page.
Select your new Button and a Launch Page to create a new transaction in your related app will open.
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.