Skip to main content
From 16:00 UTC on January 17, 2026, to 20:00 UTC on January 17, 2026, we will perform planned maintenance on the Trailhead, myTrailhead, and Trailblazer Community sites. During the maintenance, these sites will be unavailable, and users won't be able to access them. Please plan your activities around this required maintenance.

时间估计

调用和测试代码

备注

备注

用中文(简体)学习?在中文(简体)Trailhead Playground 中开始挑战,用括号中提供的译文完成挑战。仅复制并粘贴英文值,因为挑战验证基于英文数据。如果在中文(简体)组织中没有成功通过挑战,我们建议您 (1) 将区域设置切换为美国,(2) 按此处说明将语言切换为英文,(3) 再次单击“检查挑战”按钮。

查看 Trailhead 本地化语言徽章详细了解如何利用 Trailhead 译文。

运行代码

匿名块是不会被存储的 Apex 代码,但可以直接从 Developer Console 按需编译和执行。这是测试 Apex 类或运行示例代码的好方法。

  1. 在 Developer Console 中,选择 Debug(调试) | Open Execute Anonymous Window(打开执行匿名窗口)
  2. 在 Enter Apex Code(输入 Apex 代码)窗口中,输入以下内容:
    OlderAccountsUtility.updateOlderAccounts();
    
  3. 在右下角,单击 Execute(执行)
在 Salesforce 帮助中分享 Trailhead 反馈

我们很想听听您使用 Trailhead 的经验——您现在可以随时从 Salesforce 帮助网站访问新的反馈表单。

了解更多 继续分享反馈