Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Dreamforce2024に行ってきました Agentforce for Developer...

Avatar for nakofg nakofg
October 07, 2024

Dreamforce2024に行ってきました Agentforce for Developers編/I went to Dreamforce 2024 part2

2024/10/7 Dreamforce Global Gathering for Dev/Arch
#df24

Avatar for nakofg

nakofg

October 07, 2024
Tweet

More Decks by nakofg

Other Decks in Technology

Transcript

  1. 栄木 菜緒子(えいき なおこ) 
 株式会社キットアライブ クラウドソリューション部 
 アソシエイト
 Salesforce MVP,

    2024 | X(旧Twitter):@nakofg 
 <普段の仕事>
 ・Salesforce導入企業のサポート 
 ・AppExchange製品の開発 
 ・エンジニアチームマネジメント 
 <コミュニティグループ> 
 ・Salesforce Japan Woman In Tech 
 共同リーダー
 ・Salesforce女子部 運営 
 ・Japan Dreamin’ 運営 
 
 

  2. dreamforcе Home Sessions Speakers Sponsors Logout Attendee portal Dreamforce Recap

    Hi NAOKO, check out your personalized Dreamforce Recaр. The event may be over, but the learning continues. Look at what you accomplished at Dreamforce. 3 5 3 Keynotes Breakouts Theaters Meetings You learned a lot this week.
  3. Developer tools to unleash productivity LWC Local Development Beta Agentforce

    for Developers GA Now ApexGuru GA | Now Scale Center GA | Now To quickly learm more about this extension, visit the [email protected] Plese This isa Ask Eins 35:54/51:24 ur\Mapping/gии HD Developer Keynote: Build the Future with the Platform | Dreamforce 2024 | Salesforce Salesforce salesforce 登録済み チャンネル登録者数 82.4万人 32 共有 不 オフライン salesforce
  4. Enable Agentforce for Developers in Code Builder By default, Agentforce

    for Developers is turned off in new Code Builder environments. To turn it on, first enable Salesforce telemetry. Then, click the Agentforce icon in the status bar and enable the extension. After you turn on the extension, you can turn telemetry back off if you prefer. Use Agentforce for Developers in a Scratch Org Agentforce for Developers is only available in scratch org editions that can author Apex: Developer Edition Enterprise Edition To use Agentforce for Developers in a scratch org: 1. Enable Agentforce for Developers in the Dev Hub. 2. Use the SFDX: Authorize a Dev Hub command to log into the Dev Hub. 3. Activate Agentforce for Developers by turning on the EinsteinGPTForDevelopers scratch org feature: Edit the config/project-scratch-def. json file in your DX project and add the "EinsteinGPTForDeve lopers"feature to your existing feature list and save your changes. For example: } "orgName": "Acme Company", "edition": "Developer", "features": ["Communities", "ServiceCloud", "EinsteinGPTForDevelopers"] }
  5. AGENTFORCE: DEV ASSISTANT VerifyDate.cls force-app QueryContact.cls > main > default

    > classes > QueryContact.cls Π [email protected] 4 * https://trailhead.salesforce.com/ja/content/learn/modules/platform-developer-i-certification-maintenance-wi 5 /explain 6 public class QueryContact{ 7 public static Id getContactID(String lastName, String title) Dev Assistant 8 try { > Used /explain +1 reference 9 Contact myContact = Database.query( 10 'SELECT ID FROM Contact WHERE lastName = :lastName AND title = :title LIMIT 1' The code defines a class named QueryContact with two methods: getContactID and getContactIDWithBinds. Both methods are designed to retrieve the ID of a contact based on the provided last name and title. The main difference between the two methods is the way they handle the query. 11 ); 12 return myContact.Id; 13 14 } catch (Exception ex) { return null; 15 16 1. getContactID method accepts two parameters, lastName and title, and constructs a SOQL query using string concatenation. It then executes the query using the Database.query method and returns the ID of the first matching contact. If no matching contact is found, it returns null. 2. getContactIDWithBinds method accepts a map of bind variables as a parameter. Bind variables are used to avoid SOQL injection vulnerabilities. This method constructs a SOQL query with placeholders for the bind variables and then executes the query using the Database.queryWithBinds method. The bindVars map is used to replace the placeholders with the actual values. The method returns the ID of the first matching contact, or null if no matching contact is found. Both methods are designed to demonstrate how to use SOQL queries with bind variables to retrieve data from the Contact object. The getContactID method is a simple example, while the getContactIDWithBinds method is a more secure and recommended approach. 17 18 19 20 21 22 23 public static Id getContactIDWithBinds(Map<String, Object> bindVars) { //do not modify any code above this line //implement the logic that will use bindVars to retrieve the contact's ID String queryString = 'SELECT ID FROM Contact WHERE lastName = :lastName AND title = :title LIMIT 1'; List<Contact> contactList = Database.queryWithBinds(queryString, bindVars, AccessLevel.USER_MODE); if (contactList.size () > 0) { return contactList[0].Id; 24 } else 25 return null; 26 27 28 問題 出力 デバッグ コンソール ターミナル ポート HISTORY Salesforce CLI
  6. このコードは、getContactID と getContactIDWithBinds という 2 つのメソッドを持つ QueryContact というク ラスを定義します。どちらのメソッドも、指定された姓とタイトルに基づいて連絡先の ID

    を取得するように 設計されています。2 つのメソッドの主な違いは、クエリの処理方法です。 
 getContactID メソッドは、lastName と title という 2 つのパラメータを受け入れ、文字列連結を使用して SOQL クエリを構築します。次に、Database.query メソッドを使用してクエリを実行し、最初に一致する連絡 先の ID を返します。一致する連絡先が見つからない場合は、null を返します。 
 getContactIDWithBinds メソッドは、バインド変数のマップをパラメータとして受け入れます。バインド変数 は、SOQL インジェクションの脆弱性を回避するために使用されます。このメソッドは、バインド変数のプ レースホルダーを使用して SOQL クエリを構築し、Database.queryWithBinds メソッドを使用してクエリを実 行します。bindVars マップは、プレースホルダーを実際の値に置き換えるために使用されます。このメソッ ドは、最初に一致する連絡先の ID を返します。一致する連絡先が見つからない場合は、null を返します。 
 どちらの方法も、バインド変数を使用した SOQL クエリを使用して Contact オブジェクトからデータを 取得する方法を示すために設計されています。getContactID メソッドは単純な例ですが、 getContactIDWithBinds メソッドはより安全で推奨される方法です。 

  7. AGENTFORCE: DEV ASSISTANT Dev Assistant Used /document +1 reference QueryContact.cls

    X force-app > main > default > classes >. QueryContact.cls > ... 1 /** 2 3 ・SOQL クエリにバインド変数を使ってみる Apex 0 4 認定 Platform デベロッパー資格の更新 (Winter '24) https://trailhead.salesforce.com/ja/content/learn/modules/plat 5 /** 6 public class QueryContact { /** * 認定 Platform デベロッパー資格の更新 (Winter '24) * SOOL クエリにバインド変数を使ってみる * https://trailhead.salesforce.com/ja/content/learn/modules/platform-deve loper-i-certification-maintenance-winter- 24/get-hands-on-with-bind-variables-in-a-soql-query public class QueryContact { lastName と title から Contact を取得する 7 8 9 10 public static Id getContactID(String lastName, String title) try { Contact myContact = Database.query( 'SELECT ID FROM Contact WHERE lastName = :lastNam 11 ); 12 return myContact.Id; @param lastName 姓 @param title 役職 13 * @return Contact の ID 14 } catch (Exception ex) { return null; 15 public static Id getContactID(String lastName, String title) { 16 try{ Contact myContact = Database.query( 17 'SELECT ID FROM Contact WHERE lastName = : lastName AND title = :title LIMIT 1 18 19 return myContact.Id; } catch (Exception ex) { 20 return null; 21 public static Id getContactIDWithBinds(Map<String, Object> bi //do not modify any code above this line //implement the logic that will use bindVars to retrieve String queryString = 'SELECT ID FROM Contact WHERE lastNa List<Contact> contactList = Database.queryWithBinds (query 22 if (contactList.size () > 0) } 23 return contactList[0].Id; /** 24 } else } lastName と title から Contact を取得する (バインド変数を使う) @param bindVars バインド変数 @return Contact ID public static Id getContactIDWithBinds (Map<String, Object> bindVars) { //do not modify any code above this line //implement the logic that will use bindVars to retrieve the contact's ID String queryString = 'SELECT ID FROM Contact WHERE lastName = : lastName AND title = :title LIMIT 1'; List<Contact> contactList = Database.queryWithBinds (queryString, bindVars, AccessLevel.USER MODE): if (contactList.size () > 0) return contactList[0].Id; } else { return null; 25 return null; 26 27 28 問題 出力 デバッグ コンソール Salesforce CLI Ask Dev Assistant or type '/" for commands
  8. sale PAT LOUISe GoLag Shunpe Sharpy Sharpie Sharbé WW0997 WW86094

    RAWIN 5555555 יייייי WW0988 7860MM Z Z Z Z LbbOMM SSSSSSSs HODGE MW0993 9890MM Activity: Marshmallow Challenge The Task Your table has 18 minutes to build the tallest freestanding structure with the materials provided. Rules: The entire marshmallow MUST be on top: No cutting or eating part of the marshmallow. Use as much or as little of the kit as your team decides. You cannot use the tray or scissors as part of your structure and it must be free standing. No hanging materials from the ceiling. Height is measured from the table top to the top of the marshmallow. You cannot use the internet, Chat GPT, etc! salesforce
  9. Welcome, Wornen in Tech 0 Welcome, Women in Tech! Debbio

    mbauch CHO Own Company Christine Marhal Courses and Communty Orector Calestece n fracie HHart Manager, Ko Appicatio Cacach La Gina Par Dc, раа Appcton O CarÁ