Add custom properties
Last updated
Last updated
Custom properties can be added to standard objects (such as the Account object) and to custom objects like the Prescription object.
You can add a custom property from an object's detail view:
Select Settings > Objects on the left-hand menu.
Select the label of an object you'd like to view.
Scroll down to the Custom Properties pane and click New Property.
On the Create Property screen, you can fill out:
Property Label: Enter the label for your property that will be displayed in the UI.
Property Name: Enter the API name for your property.
Property Type: Select the type of property to create. For more information on property types, see primitive types in the API documentation.
Property Access: Select the access levels that users and roles have to this property.
Click Create Property. The Create Property screen is displayed.
Since we're creating a Prescription object, we'll need to create a number of properties to represent a patient's prescription. The following table shows a few properties that we'll need to create:
Label | Name | Type | Description |
Date |
| Date | Date of the prescription |
Dispense |
| Number | Amount to dispense per refill |
Patient |
| Reference | Reference to the patient account |
Provider |
| Reference | Reference to the provider account |
Refills |
| Number | Number of refills |
Rx |
| String | Prescription details |
First, we'll create the Patient property.
On the Create Property screen, select Reference from the Property Type list. More options particular to the reference property type will be displayed.
For Source Object, select Account. We want to relate the prescription to the patient's account record.
For Required Access, select Connected. This means that whoever is creating the prescription will need to have at least that level of access to the patient's account record.
For Expandable, leave it as selected.
For Grant Access, select Read.
Check Indexed. This will allow us to query prescriptions by patient account \_id
.
Click Create Property once the property has been configured.
After creating the Patient property, you will see it listed under Custom Properties of the object's detail view.
Next, we'll create the Date property.
On the Create Property screen, select Date as the property type.
Check Date Only, as this does not need to be a date-time property.
Check Indexed so that we can query prescriptions by date.
Click Create Property once the date property has been configured.
Next, we'll create the Rx property. This time we will:
On the Create Property screen, select String as the property type.
Check Indexed.
Enter a value in the Max Length field that is appropriate.
Click Create Property once the property has been configured.
Finally, create a few more properties to complete the object.