17. Apex DB のレコード管理 レコードの ID (プライマリキー) パーマリンク(固定リンク) 他のオブジェクトを参照している項目は ID で登録されています。 関連リストに表示されるデータは RDB のようにレコードの ID で関連づいています。 開発
18. 参考: Apex DB 標準オブジェクト ER 図 See : Apex Web Services API Developer's Guide http:// www.salesforce.com/us/developer/docs/api/index.htm 開発 リード Lead キャンペーン Campaign 取引先責任者 Contact 取引先 Account 商談 Opportunity ケース Case
38. Apex Code Your Code Our Servers Integer NUM = 10; Account[] accs; // Clean up old data accs = [select id from account where name like 'test%']; delete accs; commit; accs = new Account[NUM]; for (Integer i = 0; i < NUM; i++) { accs[i] = new Account(name='test ' + i, outstandingshares__c=i); } insert accs; Contact[] cons = new Contact[0];
40. Apex プラットフォームでのコード実行 Apex コードコンポーネントはそれぞれ独立して作成される Apex コンポーネントは Apex 仮想マシン上でそれぞれ隔離された状態で実行され、コードの暴走が起こらないようになっている Apex コンポーネントは API バージョンに対応した特定のバージョンの Apex VM に関連づけられ、アップグレードの際も影響を受けずに運用可能となる
41. Apex Code と Web サービス API 外部サーバ or クライアント端末 SOAP WSDL WSDL WSDL SOAP Apex Code を Web サービスとして公開
42. Apex Code の例 Integer NUM = 10; Account[] accs; // Clean up old data accs = [select id from account where name like 'test%']; delete accs; commit; accs = new Account[NUM]; for (Integer i = 0; i < NUM; i++) { accs[i] = new Account(name='test '+i, outstandingshares__c=i); } insert accs; Contact[] cons = new Contact[0]; for (Account acc : accs) { cons.add( new Contact(lastName=acc.name + '1', accounted=acc.id) ); cons.add( new Contact(lastName=acc.name + '2', accounted=acc.id) ); } insert cons;