From cf7933e799bfc8eb80d9ca944aa5dd8eaab1f880 Mon Sep 17 00:00:00 2001 From: Austin Turner Date: Thu, 21 May 2026 08:29:37 -0700 Subject: [PATCH 1/2] feat: keep record modal open after edit/create/clone Also add option to refresh the record as this could be desired action if automation runs in the background resolves #1738 --- .../src/record/ViewEditCloneRecord.tsx | 25 ++++++++++++++++--- .../src/record/ViewEditCloneRecordWrapper.tsx | 21 ++++++++++++++-- 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/libs/shared/ui-core/src/record/ViewEditCloneRecord.tsx b/libs/shared/ui-core/src/record/ViewEditCloneRecord.tsx index fdd7b23c4..77f3e65ce 100644 --- a/libs/shared/ui-core/src/record/ViewEditCloneRecord.tsx +++ b/libs/shared/ui-core/src/record/ViewEditCloneRecord.tsx @@ -120,8 +120,9 @@ export interface ViewEditCloneRecordProps { action: CloneEditView; sobjectName: string; recordId: string | null; - onClose: (reloadRecords?: boolean) => void; + onClose: () => void; onChangeAction: (action: CloneEditView) => void; + onSave: (saved: { recordId: string; sobjectName: string }) => void; onFetch?: (recordId: string, record: any) => void; onFetchError?: (recordId: string, sobjectName: string) => void; } @@ -134,6 +135,7 @@ export const ViewEditCloneRecord: FunctionComponent = recordId: initialRecordId, onClose, onChangeAction, + onSave, onFetch, onFetchError, }) => { @@ -343,9 +345,12 @@ export const ViewEditCloneRecord: FunctionComponent = if (isErrorResponse(recordResponse)) { setFormErrors(handleEditFormErrorResponse(recordResponse)); } else { - // record created/updated - hasEverBeenInViewMode.current ? onChangeAction('view') : onClose(true); - // onClose(true); + // record created/updated - hand off to wrapper which re-keys this component + // so all internal form state (modifiedRecord, formErrors, breadcrumbs) is reset + onSave({ + recordId: action === 'edit' ? (recordId as string) : recordResponse.id, + sobjectName, + }); } } } catch (ex) { @@ -646,6 +651,18 @@ export const ViewEditCloneRecord: FunctionComponent = /> {isViewAsJson ? 'View as Record' : 'View as JSON'} +