You can create a Contract in two ways:
- Import a contract from another company as part of the solution in the .e365 format.
- Create a contract from scratch.
начало внимание
Only users included in the Administrators group can create and configure contracts.
конец внимание
Import a contract from a .e365 file
A contract can only be imported from another company as part of a workspace or solution. To add a contract, you must export the workspace or solution in which it is created as a .e365 file, and then import the entire contents of the file into your company. This will upload the contract with only the source apps that are part of the imported file.
Let’s look at an example of importing a contract. Suppose that in the Orders workspace you have created a Documents contract with the following sources:
Contracts app included in the Orders workspace.
Invoices app from another workspace, All Documents.
To add a contract to another company, we export the entire workspace that includes the contract. When you export the Orders workspace you will see a warning that the contract has sources from workspaces that are not exported. Continue to export the workspace by selecting export to .e365 file format.
When importing the Orders workspace, the Documents contract will also be added to the company. In the list of its sources, only the Contracts app will be displayed, because the source of the Invoice has not been exported to the file.
Read more about the process of exporting and importing system components in the articles:
- Export workspace.
- Create a workspace.
- Export a solution to a .e365 file.
- Import a solution from a .e365 file.
Create a contract from scratch
Contracts are created in workspaces. You can add a new contract the same way as a standard BRIX app:
- Open the workspace and click the Add button in the left menu.
- Select the Contract option.
- In the window that opens, fill out the information about the contract.
- Contract name*. Enter the contract’s name that will be displayed in the left menu.
- Contract URL. The link is formed automatically based on the contract’s name. While you’re creating a contract, you can edit this link. It is used to access the contract quickly.
- Visibility. Specify who can see the contract in the left menu of the workspace:
- Visible to everyone. The contract will be available to all users.
- Only to administrators. The contract will be available only to users included in the Administrators group.
- Contract icon. A small image assigned to the contract that is displayed in the left menu of the workspace. It helps users find the right app faster.
- View. Choose the way items will be displayed on the contract’s page: Tiles or Table. The view you choose will be automatically applied for all users.
- Click Create.
- In the opened Form Settings you can add custom properties to the contract context. You can skip this step by clicking Save in the upper right corner of the window and configure the contract fields later.
Configure a contract’s form
When you configure a form for a standard app, you add fields that users will need to fill out when they create new app items. As Contracts are interfaces that display data from source apps, users won’t be able to create a contract item. In the Form Settings window, you must add properties to the Contract, to which the values of its source fields will be passed in the future.
Contract’s system properties
System fields that any source app has by default are automatically added to a contract: ID, Created on, Author, Changed, Editor, Deleted, and Name. You cannot delete them. When you add a new source app to a contract, these fields will be linked automatically.
The form also includes another default field, Link to original*. This field links the contract item with the source app item. When a new item is added to the contract, the link to the original app item will be passed to this field. You will be able to use this property in business processes and scripts.
Add custom properties
You can also create custom fields to pass other data from source apps to the contract. To do that, drag the properties you need from the side panel to the left side of the Form Settings window.
Note that when a source app and a contract are being linked, the system matches types of fields, not their names. For each source app field you want to pass, you need to create a property of the corresponding type in the contract. For example, to pass the Responsible Manager field from the source app, you need to create a field of the Users type in the contract.
Later, it will not be possible to link the contract with an app that does not include a Users type field.
Read more about all available types of app item properties in the System data types article. For more information about adding custom properties to a contract, see Work with contract fields.
To finish configuring the contract form, click Save in the upper right corner of the Form Settings window.The created contract will appear in the workspace’s left menu.