-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #610 from jetstreamapp/feat/553
Added ability to create custom objects from the create fields page
- Loading branch information
Showing
36 changed files
with
1,743 additions
and
120 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
id: deploy-object | ||
title: Create Custom Object | ||
description: Jetstream makes it easy to quickly create a new Custom Object. | ||
keywords: [ | ||
salesforce, | ||
salesforce admin, | ||
salesforce developer, | ||
salesforce automation, | ||
salesforce workbench | ||
create custom object, | ||
update custom object, | ||
field level security, | ||
page layout, | ||
] | ||
sidebar_label: Create Custom Object | ||
slug: /deploy-object | ||
--- | ||
|
||
import Success from '../assets/icons/Success.svg'; | ||
|
||
## Getting Started | ||
|
||
You can quickly deploy a new Custom Object in Jetstream from the **Create Object and Fields** page. | ||
|
||
Jetstream allows creating one object at a time, usually you would do this prior to creating new custom fields for the object. | ||
|
||
From the **Create Object and Fields** page, click the **Create New Object** button to open the modal to guide you through the process. | ||
|
||
## Configure Permissions | ||
|
||
Choose the profiles and permission sets you would like to assign permissions to, and choose which permissions you would like to apply. | ||
|
||
<img src={require('./create-object-permissions.png').default} alt="Create object permissions" /> | ||
|
||
## Configure Object | ||
|
||
Configure your object. Jetstream will automatically populate the object plural label, API name, and Field Name fields for you when you modify the label to make the process simple. You can adjust the automatically populated values as needed. | ||
|
||
Refer to Salesforce documentation on specific details for configuring a new custom object. | ||
|
||
<img src={require('./create-object-form.png').default} alt="Create object form" /> | ||
|
||
## Review Results | ||
|
||
Once you start the deployment, review the results on the the **Results** tab. | ||
|
||
Once you close the modal, the list of objects will be refreshed and the newly created object will be available for selection to create new custom fields. | ||
|
||
<img src={require('./create-object-results.png').default} alt="Create object results" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
...tstream/src/app/components/create-object-and-fields/create-new-object/CreateNewObject.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
import { SalesforceOrgUi } from '@jetstream/types'; | ||
import { Fragment, FunctionComponent, useState } from 'react'; | ||
import { useResetRecoilState, useSetRecoilState } from 'recoil'; | ||
import { CreateNewObjectModal } from './CreateNewObjectModal'; | ||
import * as fromCreateObjectState from './create-object-state'; | ||
|
||
export interface CreateNewObjectProps { | ||
selectedOrg: SalesforceOrgUi; | ||
initialSelectedProfiles?: string[]; | ||
initialSelectedPermissionSets?: string[]; | ||
onClose: (createdNewObject?: boolean) => void; | ||
} | ||
|
||
export const CreateNewObject: FunctionComponent<CreateNewObjectProps> = ({ | ||
selectedOrg, | ||
initialSelectedProfiles = [], | ||
initialSelectedPermissionSets = [], | ||
onClose, | ||
}) => { | ||
const setSelectedProfiles = useSetRecoilState(fromCreateObjectState.selectedProfilesState); | ||
const setSelectedPermissionSets = useSetRecoilState(fromCreateObjectState.selectedPermissionSetsState); | ||
|
||
const resetLabelState = useResetRecoilState(fromCreateObjectState.labelState); | ||
const resetPluralLabelState = useResetRecoilState(fromCreateObjectState.pluralLabelState); | ||
const resetStartsWithState = useResetRecoilState(fromCreateObjectState.startsWithState); | ||
const resetApiNameState = useResetRecoilState(fromCreateObjectState.apiNameState); | ||
const resetDescriptionState = useResetRecoilState(fromCreateObjectState.descriptionState); | ||
const resetRecordNameState = useResetRecoilState(fromCreateObjectState.recordNameState); | ||
const resetDataTypeState = useResetRecoilState(fromCreateObjectState.dataTypeState); | ||
const resetDisplayFormatState = useResetRecoilState(fromCreateObjectState.displayFormatState); | ||
const resetStartingNumberState = useResetRecoilState(fromCreateObjectState.startingNumberState); | ||
const resetAllowReportsState = useResetRecoilState(fromCreateObjectState.allowReportsState); | ||
const resetAllowActivitiesState = useResetRecoilState(fromCreateObjectState.allowActivitiesState); | ||
const resetTrackFieldHistoryState = useResetRecoilState(fromCreateObjectState.trackFieldHistoryState); | ||
const resetAllowInChatterGroupsState = useResetRecoilState(fromCreateObjectState.allowInChatterGroupsState); | ||
const resetAllowSharingBulkStreamingState = useResetRecoilState(fromCreateObjectState.allowSharingBulkStreamingState); | ||
const resetAllowSearchState = useResetRecoilState(fromCreateObjectState.allowSearchState); | ||
const resetCreateTabState = useResetRecoilState(fromCreateObjectState.createTabState); | ||
const resetSelectedTabIconState = useResetRecoilState(fromCreateObjectState.selectedTabIconState); | ||
const resetProfilesState = useResetRecoilState(fromCreateObjectState.profilesState); | ||
const resetPermissionSetsState = useResetRecoilState(fromCreateObjectState.permissionSetsState); | ||
const resetSelectedProfilesState = useResetRecoilState(fromCreateObjectState.selectedProfilesState); | ||
const resetSelectedPermissionSetsState = useResetRecoilState(fromCreateObjectState.selectedPermissionSetsState); | ||
const resetObjectPermissionsState = useResetRecoilState(fromCreateObjectState.objectPermissionsState); | ||
|
||
const [modalOpen, setModalOpen] = useState(false); | ||
|
||
const resetAll = () => { | ||
resetLabelState(); | ||
resetPluralLabelState(); | ||
resetStartsWithState(); | ||
resetApiNameState(); | ||
resetDescriptionState(); | ||
resetRecordNameState(); | ||
resetDataTypeState(); | ||
resetDisplayFormatState(); | ||
resetStartingNumberState(); | ||
resetAllowReportsState(); | ||
resetAllowActivitiesState(); | ||
resetTrackFieldHistoryState(); | ||
resetAllowInChatterGroupsState(); | ||
resetAllowSharingBulkStreamingState(); | ||
resetAllowSearchState(); | ||
resetCreateTabState(); | ||
resetSelectedTabIconState(); | ||
resetProfilesState(); | ||
resetPermissionSetsState(); | ||
resetSelectedProfilesState(); | ||
resetSelectedPermissionSetsState(); | ||
resetObjectPermissionsState(); | ||
}; | ||
|
||
const handleClose = (createdNewObject?: boolean) => { | ||
setModalOpen(false); | ||
onClose(createdNewObject); | ||
resetAll(); | ||
}; | ||
|
||
return ( | ||
<Fragment> | ||
<button | ||
className="slds-button slds-button_neutral" | ||
onClick={() => { | ||
resetAll(); | ||
setSelectedProfiles(initialSelectedProfiles); | ||
setSelectedPermissionSets(initialSelectedPermissionSets); | ||
setModalOpen(true); | ||
}} | ||
> | ||
Create New Object | ||
</button> | ||
|
||
{modalOpen && <CreateNewObjectModal onClose={handleClose} selectedOrg={selectedOrg} />} | ||
</Fragment> | ||
); | ||
}; | ||
|
||
export default CreateNewObject; |
Oops, something went wrong.