Work with objects and fields
Overview
The Skedulo CLI allows you to manage objects and fields efficiently, providing operations such as create, delete, update, and list.
This guide covers best practices for safely managing objects and fields, modifying vocabulary options on standard fields, and understanding reference field behaviors.
Note
This page covers Skedulo Pulse Platform only. Skedulo for Salesforce doesn’t use the CLI for any of this: objects and fields are created and mapped directly in Salesforce, and the standard object label override isn’t offered to Salesforce tenants. See Create custom objects in Salesforce for that process; the CLI has no equivalent for Salesforce field mappings yet.Manage objects and fields
Objects and fields represent data structures and attributes within Skedulo. Fields are defined within objects and each object can have multiple custom fields to store various types of data.
The Skedulo CLI allows you to manage these elements via commands that enable you to create, update, retrieve, and delete custom objects and fields. For more on this, see the Work with artifacts section or the artifacts command reference.
Object labels
Standard and custom objects both have a singular label and a plural label, but you manage each using a different artifact.
Standard object labels
Override a standard object’s label with the standard-object-override artifact. For a first-time rename, write a state file yourself; there’s no existing override to export yet. For example, to rename Jobs to Appointments, create Jobs.standard-object-override.json:
{
"metadata": {
"type": "StandardObjectOverride"
},
"objectName": "Jobs",
"label": "Appointment",
"labelPlural": "Appointments"
}
Then apply it:
sked artifacts standard-object-override upsert -f Jobs.standard-object-override.json
To read back an override that already exists, use get:
sked artifacts standard-object-override get --objectName Jobs
You must set at least one of label or labelPlural; whichever you leave out keeps the object’s derived value. Deleting the artifact clears the override and reverts the object to its derived labels; it doesn’t delete the object itself.
This override works the same way as one set from Objects & fields in the web app; see Where a customized object label appears for where the new label does and doesn’t show up.
Note
standard-object-override is currently in beta. See the command reference for all supported operations.
Custom object labels
A custom object’s custom-object artifact carries both a singular label and a labelPlural, alongside its other properties:
sked artifacts custom-object get --name MyCustomObject
{
"metadata": {
"type": "CustomObject"
},
"name": "MyCustomObject",
"label": "My Object",
"labelPlural": "My Objects",
"description": "My Object Description"
}
sked artifacts custom-object upsert -f MyCustomObject.custom-object.json
This only applies to objects you’ve created yourself. Targeting a standard object’s name with custom-object fails; use standard-object-override above instead.
Considerations when deleting objects and fields
Data loss
When you delete an object or field via the Skedulo CLI, it is removed from the system and any associated data is immediately lost forever.
Best practice
Always double-check that you no longer need the object or field and make sure to export and back up any critical data before performing deletions.Reference type fields
When you delete a Lookup field, all corresponding Has-many relationships that reference the deleted Lookup field will also be deleted. However, deleting a Has-many field does not affect the corresponding Lookup field.
For example, if you have two fields:
AssignedResource: A Lookup field onJobsthat referencesResources.ResourceJobs: A Has-many field onResourcesthat references theAssignedResourceLookup.
deleting AssignedResource will also delete ResourceJobs. However, deleting ResourceJobs will not delete AssignedResource.
See the Lookup and Has-many field type documentation for more information about how these fields work.
Modify vocabulary options on standard fields
While you cannot edit the definition of a standard field, you can customize the vocabulary options (i.e., the allowed values) associated with a standard field, such as the AbortReason field on Jobs. Standard fields can be found in the object reference or in the Objects & fields section in the settings menu of the Skedulo web app.
For example, the AbortReason field on Jobs is a StandardPicklist. You can edit or deactivate existing options, or add new options by following the steps below:
-
Export the current state of the
AbortReasonfield by running the following Skedulo CLI command:sked artifacts custom-field get --objectName Jobs --name AbortReasonThis command will retrieve the field state and save it as a
.custom-field.jsonfile. -
Open the exported file (
Jobs-AbortReason.custom-field.json) in a text editor and modify the existing options, or add new ones. In this example,Weather relatedhas been added andAppointment missedhas been deactivated:{ "metadata": { "type": "CustomField" }, "objectName": "Jobs", "name": "AbortReason", "field": { "type": "StandardPicklist", "allowedValues": [ { "value": "Customer no show", "label": "Customer no show", "active": true, "default": false }, { "value": "Canceled by customer", "label": "Canceled by customer", "active": true, "default": false }, { "value": "Appointment missed", "label": "Appointment missed", "active": false, "default": false }, { "value": "Weather related", "label": "Weather related", "active": true, "default": false } ] } }
Note
Once a vocabulary item is added to the field, it cannot be deleted. If you remove an allowed value from the state file, the option will be deactivated by setting"active": false. This means the item is no longer usable and will no longer appear as an option.
-
Once you are satisfied with the changes to the vocabulary options, you can apply the updates by running the following command:
sked artifacts custom-field upsert -f Jobs-AbortReason.custom-field.jsonThis will update the
AbortReasonfield onJobswith the new vocabulary options you have defined.
Next steps
Now that you’ve managed objects and fields with the Skedulo CLI, check out:
Feedback
Was this page helpful?