Search In This Blog

2024-07-30

How to use Einstein Generative AI in Todo(Task) object

In the Prompt Builder, it is not possible to select a ToDo object and create a prompt template using its fields. However, you can achieve similar functionality by utilizing a related object. Follow these steps:

  1. Create a Related Object: Create a related object to the ToDo object.

  2. Add a Field for Processing: Add a specific field on the related object for processing purposes.

  3. Generate a Common Record: Create a record for all ToDo records.

  4. Develop a Prompt Template: Design a prompt template on the field of the related object.

  5. Implement a Trigger Flow: Set up a trigger flow on the ToDo object. Step 1: retrieve the related object record by ToDo related record ID. Step 2: Assign the target field value of ToDo record to this related object record. Step 3: Update it within the flow. Step 4: Pass the related object record to the prompt template action, now it is able to obtain the prompt output for further updates or other actions.



2024-07-10

Salesforce Integration User License can not access account, etc by dataloader

Issue

Using the Salesforce Integration profile cannot find account, etc in object list.

Solution

Use Permission Set to allow acess to account, etc
When create Permission Set, select lisence as Salesforce API Integration. Don't select Salesforce Integration.
In Object Settings page, allow target objects permission.
If you want access to task, set the permission in System Permissions page. Check on "Access Activities" and "Edit Tasks".

2024-07-08

Some Considerations before you release Restriction Rules by Change Set

Restriction rules allow certain users to access only specified records. Restriction Rules are not actived as default, so you need to create a case to ask Salesforce to active Restriction Rules for your organization.

Restriction Rules can be release by change set, before that you need to make sure if Restriction Rules are actived in the target organization.

2024-05-07

Salesforce認定 AIアソシエイト合格体験記

Salesforce認定AIアソシエイト試験の合格体験記です。
〇試験について
難易度は低いです。誰も受験できます。
内容:多肢選択/複数選択方式の 40 問
試験時間:70 分
合格点:65 %(26 問以上で合格)
受験料:10,000 円(税抜)
再受験:無料試験

〇問題範囲について
AI の基本事項: 全問中 17%
CRM での AI 機能: 全問中 8%
AI の倫理的な考慮事項: 全問中 39%
AI 用のデータ: 全問中 36%

〇学習方法について
筆者は公式のTrailmixで勉強しました。一発合格です。
https://trailhead.salesforce.com/ja/users/strailhead/trailmixes/prepare-for-your-salesforce-ai-associate-credential
※Trailmix中のモジュールにある練習問題は実際試験中に出ました。
Trailmixの内容を理解できていれば、合格できると思います。元々AI知識を持っている人なら、「CRM での AI 機能」をメインに勉強すれば、簡単に合格できるかもしれません。

2024-04-24

Jest issue: Fix TypeError getAccountInfo(...).then is not a function (test apex class inside @wire method)

To mock an Apex class
import getAccountInfo from "@salesforce/apex/CustomCtrl.getAccountInfo"

@wire(getRecord,[...])
wireRecord() {
    getAccountInfo(accountId).then(do somethings)
}

Create the jest mock.
jest.mock(
    "@salesforce/apex/CustomCtrl.getAccountInfo",
    () => { return { default: jest.fn(), } }, { virtual: true }
)
 
But mocked apex is called inside of @wire method, then getAccountInfo(...).then is not a function error is happened. Need to fix the mock as below:
jest.mock(
    "@salesforce/apex/CustomCtrl.getAccountInfo",
    () => {
        return {
            default: jest.fn((data) => {
                let mockData;
                if (data.accountId == "0000000000") {
                    mockData = [{
                    "Id": "0011700000xxxxx000",
                    "Name": "test"
                    }];
                } else if (data.accountId == "0000000001") {
                    mockData = [{
                    "Id": "0011700000xxxxx001",
                    "Name": "test1"
                    }];
                }
                // use Promise to mock getAccountInfo(...).then
                return Promise.resolve(mockData);
            }),
        };
    }, { virtual: true }
);