投稿

ラベル(Apex)が付いた投稿を表示しています

Salesforce Trailheadチャレンジメモ(Apex の基礎とデータベース)

(チャレンジの回答がどうしてもわからないとき) Trailblazer CommunityやStack Overflowで、問題文のタイトルやエラーメッセージで調べてみると回答についての投稿が見つかることがあります。 Salesforce Trailblazer Community https://success.salesforce.com/successHome Stack Overflow - Where Developers Learn, Share, & Build Careers https://stackoverflow.com/ モジュール「Apex の基礎とデータベース」 Apex の使用開始 Create an Apex class that returns an array (or list) of strings. public class StringArrayTest {     public static String[] generateStringArray(Integer numbers) {         List<String> arraylist = new List<String> ();         for(Integer i=0; i<numbers; i++) {             arraylist.add('Test ' + i);             // System.debug(arraylist[i]);         }        return arraylist;     } } あるいは、整数部分を文字列(String)にしてもチャレンジに成功します。             arraylist.add('Test ' ...

The Governor Limit and Savepoint (Salesforce Apex)

Savepoint you set counts against the governor limit for DML statements and rows. Also, rollback is also the same. Rows are the number of records. Savepoints and rollbacks were also counted in records. // // Execute Anonymous 1 // Insert 2 times, SavePoint, Rollback total 4 times. // Result, one record of X company is inserted. // Account a1 = new Account(Name = 'X Company '); insert a1; System.SavePoint sp = Database.setSavePoint(); Account a2 = new Account(Name = 'Y Company'); insert a2; Database.rollback(sp); // Debug log   Number of SOQL queries: 0 out of 100   Number of query rows: 0 out of 50000   Number of SOSL queries: 0 out of 20   Number of DML statements: 4 out of 150    <--- counts   Number of DML rows: 4 out of 10000    <--- same counts because inserted every record   Maximum CPU time: 0 out of 10000   Maximum heap size: 0 out of 6000000   Number of callouts: 0...