gccでUTF8で作ったコードが文字化けする場合の対処
コマンドプロンプト上で以下のコマンド実行する。
chcp 65001
kinkun's blog
gccでUTF8で作ったコードが文字化けする場合の対処
コマンドプロンプト上で以下のコマンド実行する。
chcp 65001
システム環境変数の設定ができなくなった場合の対処
PowerShell管理者で Start C:\Windows\system32\rundll32.exe sysdm.cpl, EditEnvironmentVariables と入力
手順
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
新しいクロスプラットフォームの PowerShell をお試しください https://aka.ms/pscore6
PS C:\WINDOWS\system32> Start C:\Windows\system32\rundll32.exe sysdm.cpl, EditEnvironmentVariables

Salesforceのディスク容量の計算

組織のエディションとユーザライセンスの数によってディスク容量は決まります。
計算式は「組織のエディションによって決まる固定ストレージ」+「ユーザライセンス数にして比例して追加されるストレージ」です。
データストレージはオブジェクトのレコードを格納する容量です。
Salesforceでは一部のオブジェクトを除いて1レコード2KBです。
データストレージの容量と組織で使用を想定しているレコード数が分かれば、容量が十分かどうかを確認することができます。
ファイルストレージは関連ファイルなどにアップロードするファイルを格納する容量です。
ファイルストレージ容量と組織で扱うファイル数・サイズが分かれば、容量が十分かどうかを確認することができます。

Lightning Web ComponentでApex呼び出し方法
■LWCから呼び出せるApexメソッド
条件
@AuraEnabledがついていること
staticであること
publicもしくはglobalであること
例)
Apexクラス作成します。
testController
public with sharing class testController {
@AuraEnabled
public static List<test__c> getRecord( String str ){
return [
SELECT
Id,
Name
FROM test__c
Where Name = str
];
}
}
■LWCからApex呼び出し
・Javascript
testLwc.js
import { ShowToastEvent } from "lightning/platformShowToastEvent";
import { CurrentPageReference } from "lightning/navigation";
import getRecord from '@salesforce/apex/testController.getRecord';
export default class testLwc extends LightningElement {
@api recordId;
@wire(CurrentPageReference)
async getStateParameters(currentPageReference) {
//ScreenActionの場合、レコード詳細画面でLightning Web コンポーネントアクション押下時のレコードID取得
this.recordId = currentPageReference.state.recordId;
//Apexクラスメソッド呼び出して、レコード取得
const rows = await getRecords({ recordId: this.recordId }).catch((e) => {
console.error(e);
//dispatchEventメソッドでカスタムイベントをディスパッチし、親コンポーネントに伝達します。
this.dispatchEvent(
new ShowToastEvent({
title: "エラーが発生しました。",
message: e.body.message,
variant: "error",
})
);
});
}
}
・xml
testLwc.js-meta.xml
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>56.0</apiVersion>
<isExposed>true</isExposed>
<targets>
<target>lightning__RecordAction</target>
</targets>
<targetConfigs>
<targetConfig targets="lightning__RecordAction">
<actionType>ScreenAction</actionType>
</targetConfig>
</targetConfigs>
</LightningComponentBundle>
・html
testLwc.html
<template>
<lightning-quick-action-panel header="test">
ここにモーダルコンテンツを記載する
<div slot="footer">
<lightning-button variant="neutral" label="ボタン1" class="slds-m-left_x-small"></lightning-button>
<lightning-button variant="brand" label="ボタン2" class="slds-m-left_x-small"></lightning-button>
</div>
</lightning-quick-action-panel>
</template>
Encoding & Decoding
Let JSON2Apex handle JSON processing in Apex
Salesforce DevTools
https://chrome.google.com/webstore/detail/salesforce-devtools/ehgmhinnhggigkogkbhnbodhbfjgncjf
Powerful Salesforce developer tools, includes Query Editor, Fields definition, ERDs, Page Layout, and others.
Salesforce DevTools is a powerful Salesforce developer chrome extension for doing the below things : ・Quickly generate Apex code / SOQL, exporting query results to Excel file. ・Quickly access to new record page, list page and object setting page of any object. ・Quickly search object fields and check its usage. ・Display fields API name on Salesforce object detail page. ・Exporting Objects Definition to Excel file. ・Exporting Objects Fields Definition to Excel file. ・Exporting Objects Page Layout Definition to Excel file. ・Exporting Objects List View Definition to Excel file. ・Salesforce data modal (ERDs) generator. ・All Check / Select on profile edit page and field permissions edit page. ・Mass edit, mass delete, mass clone custom fields (Only Classic).
Salesforce CLI(Command Line Interface)使用の流れ
・Install
https://developer.salesforce.com/ja/tools/sfdxcli
コマンドプロンプトにて、以下のコマンドを実行します。
・sfdx update
Salesforce CLI とプラグインの最新バージョンをインストールするには、次のコマンドを実行します。
・sfdx –version
現在のバージョンを確認します
・sfdx force:auth:web:login -d -a {エイリアス名}
例)sfdx force:auth:web:login -d -a devtest
ここで、「devtest」はエイリアス名
対象組織にログインします
・プロジェクト作成
例)C:\hoge>sfdx force:project:create -n hoge-project
hogeディレクトリ直下に「hoge-project」プロジェクトを作成します。
・対象組織にログインします。
例)C:\hoge>sfdx force:org:open -u test@testtesttestkkkk.com
ここで、ユーザ名「test@testtesttestkkkk.com」の場合
・プロジェクト「hoge-project」にApexクラス取得します。
例)C:\hoge\hoge-project>sfdx force:source:retrieve -m ApexClass -u devtest
ここで、「devtest」はエイリアス名
・パス指定して、取得します。
例)C:\hoge\hoge-project>sfdx force:source:retrieve -p force-app/main/default/classes -u devtest
ここで、「devtest」はエイリアス名
テストクラスカバー率確認方法
select id, ApexClassorTrigger.Name, NumLinesCovered, NumLinesUncovered from ApexCodeCoverageAggregate
Use Tooling API をON にしておく必要があります。

「nitpick」 = 些細な指摘(重箱の隅をつつくの意味)