Skip to content

The open alternative to Salesforce, designed for AI.

Fix company update with accountOwner (#2687)

Weiko851ce73609c5
diff --git a/server/src/workspace/workspace-manager/standard-objects-prefill-data/view.ts b/server/src/workspace/workspace-manager/standard-objects-prefill-data/view.ts
index 38370154e4d..ac5e7a25df1 100644
--- a/server/src/workspace/workspace-manager/standard-objects-prefill-data/view.ts
+++ b/server/src/workspace/workspace-manager/standard-objects-prefill-data/view.ts
@@ -66,6 +66,20 @@ export const viewPrefillData = async (
isVisible: true,
size: 100,
},
+ {
+ fieldMetadataId: objectMetadataMap['company'].fields['accountOwner'],
+ viewId: viewIdMap['All Companies'],
+ position: 2,
+ isVisible: true,
+ size: 150,
+ },
+ {
+ fieldMetadataId: objectMetadataMap['company'].fields['createdAt'],
+ viewId: viewIdMap['All Companies'],
+ position: 3,
+ isVisible: true,
+ size: 150,
+ },
{
fieldMetadataId: objectMetadataMap['company'].fields['employees'],
viewId: viewIdMap['All Companies'],
@@ -102,6 +116,13 @@ export const viewPrefillData = async (
isVisible: true,
size: 150,
},
+ {
+ fieldMetadataId: objectMetadataMap['person'].fields['company'],
+ viewId: viewIdMap['All People'],
+ position: 2,
+ isVisible: true,
+ size: 150,
+ },
{
fieldMetadataId: objectMetadataMap['person'].fields['phone'],
viewId: viewIdMap['All People'],
@@ -109,6 +130,13 @@ export const viewPrefillData = async (
isVisible: true,
size: 150,
},
+ {
+ fieldMetadataId: objectMetadataMap['person'].fields['createdAt'],
+ viewId: viewIdMap['All People'],
+ position: 4,
+ isVisible: true,
+ size: 150,
+ },
{
fieldMetadataId: objectMetadataMap['person'].fields['city'],
viewId: viewIdMap['All People'],
@@ -143,27 +171,27 @@ export const viewPrefillData = async (
viewId: viewIdMap['All Opportunities'],
position: 0,
isVisible: true,
- size: 180,
+ size: 150,
},
{
- fieldMetadataId: objectMetadataMap['opportunity'].fields['probability'],
+ fieldMetadataId: objectMetadataMap['opportunity'].fields['closeDate'],
viewId: viewIdMap['All Opportunities'],
position: 1,
isVisible: true,
size: 150,
},
{
- fieldMetadataId: objectMetadataMap['opportunity'].fields['closeDate'],
+ fieldMetadataId: objectMetadataMap['opportunity'].fields['probability'],
viewId: viewIdMap['All Opportunities'],
position: 2,
isVisible: true,
- size: 100,
+ size: 150,
},
{
fieldMetadataId:
objectMetadataMap['opportunity'].fields['pointOfContact'],
viewId: viewIdMap['All Opportunities'],
- position: 5,
+ position: 3,
isVisible: true,
size: 150,
},
diff --git a/server/src/workspace/workspace-manager/standard-objects/company.ts b/server/src/workspace/workspace-manager/standard-objects/company.ts
index 3a3221caf64..704b5bc15a3 100644
--- a/server/src/workspace/workspace-manager/standard-objects/company.ts
+++ b/server/src/workspace/workspace-manager/standard-objects/company.ts
@@ -150,6 +150,18 @@ const companyMetadata = {
icon: 'IconUserCircle',
isNullable: true,
},
+ {
+ isCustom: false,
+ isActive: true,
+ type: FieldMetadataType.UUID,
+ name: 'accountOwnerId',
+ label: 'Account Owner ID (foreign key)',
+ targetColumnMap: {},
+ description: 'Foreign key for account owner',
+ icon: undefined,
+ isNullable: true,
+ isSystem: true,
+ },
{
isCustom: false,
isActive: true,
diff --git a/server/src/workspace/workspace-manager/standard-objects/person.ts b/server/src/workspace/workspace-manager/standard-objects/person.ts
index 6384cc69457..1b35445e41f 100644
--- a/server/src/workspace/workspace-manager/standard-objects/person.ts
+++ b/server/src/workspace/workspace-manager/standard-objects/person.ts
@@ -63,7 +63,7 @@ const personMetadata = {
url: 'xLinkUrl',
},
description: 'Contact’s X/Twitter account',
- icon: 'IconUser',
+ icon: 'IconBrandX',
isNullable: true,
},
{