From f742434cc67152a14c0a9777f4959e5feeda5ebe Mon Sep 17 00:00:00 2001 From: Takashi Arai Date: Fri, 22 Mar 2024 12:38:28 -0700 Subject: [PATCH] First pass. --- .../createAccountRecord.html | 10 ++--- .../createAccountRecord.js | 34 +++++++++++----- .../createContactRecord.html | 12 +++--- .../createContactRecord.js | 39 +++++++++++------- .../createOpportunityRecord.html | 10 ++--- .../createOpportunityRecord.js | 39 ++++++++++++------ .../createStarterKitCustomObjectRecord.html | 12 +++--- .../createStarterKitCustomObjectRecord.js | 40 +++++++++++++------ .../editAccountRecord/editAccountRecord.js | 24 ++++++++--- .../editContactRecord/editContactRecord.js | 29 +++++++++++--- .../editOpportunityRecord.js | 24 ++++++++--- .../editStarterKitCustomObjectRecord.html | 4 +- .../editStarterKitCustomObjectRecord.js | 29 +++++++++++--- 13 files changed, 211 insertions(+), 95 deletions(-) diff --git a/force-app/main/default/lwc/createAccountRecord/createAccountRecord.html b/force-app/main/default/lwc/createAccountRecord/createAccountRecord.html index ba45993..41aceb8 100644 --- a/force-app/main/default/lwc/createAccountRecord/createAccountRecord.html +++ b/force-app/main/default/lwc/createAccountRecord/createAccountRecord.html @@ -25,11 +25,11 @@ - - - - - + + + + + diff --git a/force-app/main/default/lwc/createAccountRecord/createAccountRecord.js b/force-app/main/default/lwc/createAccountRecord/createAccountRecord.js index 6daf29f..5007237 100644 --- a/force-app/main/default/lwc/createAccountRecord/createAccountRecord.js +++ b/force-app/main/default/lwc/createAccountRecord/createAccountRecord.js @@ -10,17 +10,29 @@ export default class CreateAccountRecord extends LightningElement { @api recordId; @api objectApiName; - nameField = NAME_FIELD; - phoneField = PHONE_FIELD; - websiteField = WEBSITE_FIELD; - industryField = INDUSTRY_FIELD; - typeField = TYPE_FIELD; - - name = ""; - phone = ""; - website = ""; - industry = ""; - type = ""; + get nameField() { + return NAME_FIELD; + } + + get phoneField() { + return PHONE_FIELD; + } + + get websiteField() { + return WEBSITE_FIELD; + } + + get industryField() { + return INDUSTRY_FIELD; + } + + get typeField() { + return TYPE_FIELD; + } + + get initialValue() { + return ""; + } onSuccess(event) { console.log("Created account", event.detail); diff --git a/force-app/main/default/lwc/createContactRecord/createContactRecord.html b/force-app/main/default/lwc/createContactRecord/createContactRecord.html index 3bcb18a..d77ff5b 100644 --- a/force-app/main/default/lwc/createContactRecord/createContactRecord.html +++ b/force-app/main/default/lwc/createContactRecord/createContactRecord.html @@ -20,11 +20,11 @@ - - - - - + + + + + - - - - - + + + + + diff --git a/force-app/main/default/lwc/createOpportunityRecord/createOpportunityRecord.js b/force-app/main/default/lwc/createOpportunityRecord/createOpportunityRecord.js index c04f288..d716acb 100644 --- a/force-app/main/default/lwc/createOpportunityRecord/createOpportunityRecord.js +++ b/force-app/main/default/lwc/createOpportunityRecord/createOpportunityRecord.js @@ -10,18 +10,33 @@ export default class CreateContactRecord extends LightningElement { @api recordId; @api objectApiName; - nameField = OPPORTUNITY_NAME_FIELD; - accountField = OPPORTUNITY_ACCOUNT_FIELD; - closeDateField = OPPORTUNITY_CLOSE_DATE_FIELD; - amountField = OPPORTUNITY_AMOUNT_FIELD; - stageNameField = OPPORTUNITY_STAGENAME_FIELD; - ownerField = OPPORTUNITY_OWNER_FIELD; - - name = ""; - account = ""; - closeDate = ""; - amount = ""; - stageName = ""; + get nameField() { + return OPPORTUNITY_NAME_FIELD; + } + + get accountField() { + return OPPORTUNITY_ACCOUNT_FIELD; + } + + get closeDateField() { + return OPPORTUNITY_CLOSE_DATE_FIELD; + } + + get amountField() { + return OPPORTUNITY_AMOUNT_FIELD; + } + + get stageNameField() { + return OPPORTUNITY_STAGENAME_FIELD; + } + + get ownerField() { + return OPPORTUNITY_OWNER_FIELD; + } + + get initialValue() { + return ""; + } onSuccess(event) { console.log("Created opportunity", event.detail); diff --git a/force-app/main/default/lwc/createStarterKitCustomObjectRecord/createStarterKitCustomObjectRecord.html b/force-app/main/default/lwc/createStarterKitCustomObjectRecord/createStarterKitCustomObjectRecord.html index 49ceffe..12e4ed9 100644 --- a/force-app/main/default/lwc/createStarterKitCustomObjectRecord/createStarterKitCustomObjectRecord.html +++ b/force-app/main/default/lwc/createStarterKitCustomObjectRecord/createStarterKitCustomObjectRecord.html @@ -25,12 +25,12 @@ - - - - - - + + + + + + diff --git a/force-app/main/default/lwc/createStarterKitCustomObjectRecord/createStarterKitCustomObjectRecord.js b/force-app/main/default/lwc/createStarterKitCustomObjectRecord/createStarterKitCustomObjectRecord.js index a8d8405..25c2fe1 100644 --- a/force-app/main/default/lwc/createStarterKitCustomObjectRecord/createStarterKitCustomObjectRecord.js +++ b/force-app/main/default/lwc/createStarterKitCustomObjectRecord/createStarterKitCustomObjectRecord.js @@ -11,19 +11,33 @@ export default class CreateStarterKitCustomObject__cRecord extends LightningElem @api recordId; @api objectApiName; - nameField = NAME_FIELD; - start_Time__cField = START_TIME__C_FIELD; - end_Time__cField = END_TIME__C_FIELD; - priority__cField = PRIORITY__C_FIELD; - status__cField = STATUS__C_FIELD; - address__cField = ADDRESS__C_FIELD; - - name = ""; - start_Time__c = ""; - end_Time__c = ""; - priority__c = ""; - status__c = ""; - address__c = ""; + get nameField() { + return NAME_FIELD; + } + + get start_Time__cField() { + return START_TIME__C_FIELD; + } + + get end_Time__cField() { + return END_TIME__C_FIELD; + } + + get priority__cField() { + return PRIORITY__C_FIELD; + } + + get status__cField() { + return STATUS__C_FIELD; + } + + get address__cField() { + return ADDRESS__C_FIELD; + } + + get initialValue() { + return ""; + } onSuccess(event) { console.log("Created StarterKitCustomObject__c", event.detail); diff --git a/force-app/main/default/lwc/editAccountRecord/editAccountRecord.js b/force-app/main/default/lwc/editAccountRecord/editAccountRecord.js index 21d4b86..f8cb0af 100644 --- a/force-app/main/default/lwc/editAccountRecord/editAccountRecord.js +++ b/force-app/main/default/lwc/editAccountRecord/editAccountRecord.js @@ -11,11 +11,25 @@ export default class EditAccountRecord extends LightningElement { @api recordId; @api objectApiName; - nameField = NAME_FIELD; - phoneField = PHONE_FIELD; - websiteField = WEBSITE_FIELD; - industryField = INDUSTRY_FIELD; - typeField = TYPE_FIELD; + get nameField() { + return NAME_FIELD; + } + + get phoneField() { + return PHONE_FIELD; + } + + get websiteField() { + return WEBSITE_FIELD; + } + + get industryField() { + return INDUSTRY_FIELD; + } + + get typeField() { + return TYPE_FIELD; + } @wire(getRecord, { recordId: "$recordId", fields: [NAME_FIELD] }) record; diff --git a/force-app/main/default/lwc/editContactRecord/editContactRecord.js b/force-app/main/default/lwc/editContactRecord/editContactRecord.js index 2fc348d..98e517d 100644 --- a/force-app/main/default/lwc/editContactRecord/editContactRecord.js +++ b/force-app/main/default/lwc/editContactRecord/editContactRecord.js @@ -12,12 +12,29 @@ export default class EditContactRecord extends LightningElement { @api recordId; @api objectApiName; - nameField = CONTACT_NAME_FIELD; - titleField = CONTACT_TITLE_FIELD; - accountField = CONTACT_ACCOUNT_FIELD; - phoneField = CONTACT_PHONE_FIELD; - emailField = CONTACT_EMAIL_FIELD; - mobileField = CONTACT_MOBILE_FIELD; + get nameField() { + return CONTACT_NAME_FIELD; + } + + get titleField() { + return CONTACT_TITLE_FIELD; + } + + get accountField() { + return CONTACT_ACCOUNT_FIELD; + } + + get phoneField() { + return CONTACT_PHONE_FIELD; + } + + get emailField() { + return CONTACT_EMAIL_FIELD; + } + + get mobileField() { + return CONTACT_MOBILE_FIELD; + } @wire(getRecord, { recordId: "$recordId", fields: [CONTACT_NAME_FIELD] }) record; diff --git a/force-app/main/default/lwc/editOpportunityRecord/editOpportunityRecord.js b/force-app/main/default/lwc/editOpportunityRecord/editOpportunityRecord.js index cf8e134..9284005 100644 --- a/force-app/main/default/lwc/editOpportunityRecord/editOpportunityRecord.js +++ b/force-app/main/default/lwc/editOpportunityRecord/editOpportunityRecord.js @@ -11,11 +11,25 @@ export default class EditOpportunityRecord extends LightningElement { @api recordId; @api objectApiName; - nameField = OPPORTUNITY_NAME_FIELD; - accountField = OPPORTUNITY_ACCOUNT_FIELD; - closeDateField = OPPORTUNITY_CLOSE_DATE_FIELD; - amountField = OPPORTUNITY_AMOUNT_FIELD; - stageNameField = OPPORTUNITY_STAGENAME_FIELD; + get nameField() { + return OPPORTUNITY_NAME_FIELD; + } + + get accountField() { + return OPPORTUNITY_ACCOUNT_FIELD; + } + + get closeDateField() { + return OPPORTUNITY_CLOSE_DATE_FIELD; + } + + get amountField() { + return OPPORTUNITY_AMOUNT_FIELD; + } + + get stageNameField() { + return OPPORTUNITY_STAGENAME_FIELD; + } @wire(getRecord, { recordId: "$recordId", fields: [OPPORTUNITY_NAME_FIELD] }) record; diff --git a/force-app/main/default/lwc/editStarterKitCustomObjectRecord/editStarterKitCustomObjectRecord.html b/force-app/main/default/lwc/editStarterKitCustomObjectRecord/editStarterKitCustomObjectRecord.html index 6b45072..2118ded 100644 --- a/force-app/main/default/lwc/editStarterKitCustomObjectRecord/editStarterKitCustomObjectRecord.html +++ b/force-app/main/default/lwc/editStarterKitCustomObjectRecord/editStarterKitCustomObjectRecord.html @@ -31,7 +31,9 @@ - + + + diff --git a/force-app/main/default/lwc/editStarterKitCustomObjectRecord/editStarterKitCustomObjectRecord.js b/force-app/main/default/lwc/editStarterKitCustomObjectRecord/editStarterKitCustomObjectRecord.js index d833e5d..07d6089 100644 --- a/force-app/main/default/lwc/editStarterKitCustomObjectRecord/editStarterKitCustomObjectRecord.js +++ b/force-app/main/default/lwc/editStarterKitCustomObjectRecord/editStarterKitCustomObjectRecord.js @@ -12,12 +12,29 @@ export default class EditStarterKitCustomObject__cRecord extends LightningElemen @api recordId; @api objectApiName; - nameField = NAME_FIELD; - start_Time__cField = START_TIME__C_FIELD; - end_Time__cField = END_TIME__C_FIELD; - priority__cField = PRIORITY__C_FIELD; - status__cField = STATUS__C_FIELD; - address__cField = ADDRESS__C_FIELD; + get nameField() { + return NAME_FIELD; + } + + get start_Time__cField() { + return START_TIME__C_FIELD; + } + + get end_Time__cField() { + return END_TIME__C_FIELD; + } + + get priority__cField() { + return PRIORITY__C_FIELD; + } + + get status__cField() { + return STATUS__C_FIELD; + } + + get address__cField() { + return ADDRESS__C_FIELD; + } @wire(getRecord, { recordId: "$recordId", fields: [NAME_FIELD] }) record;