1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

salesforceのFlowBuilderでレコードIDを取得する方法

Posted at

やりたいこと

salesforceのフローを使って、プロセスを開始した時に表示しているレコードのレコードIDを取得してきたい。イメージとしてはURLが

https://hogehoge.lightning.force.com/lightning/r/Quote/xxxxxxxxxxxxxxxxxx/view

だった時の「xxxxxxxxxxxxxxxxxx」←ここを取ってきたい。

やり方

公式のヘルプによると

フローアクションでは、レコードの ID 項目の値をフローに渡すことができますが、それだけです。フローに recordId というテキスト入力変数があれば、アクションの実行時にレコードの ID がその変数に渡されます。ない場合は、レコード ID は渡されず、フローはそのまま実行されます。

とのこと。わかりにくい。が、なんかできそうってことはわかった。
やってみる。

  1. FlowBuilderから新規フローの作成をクリック
  2. 「新規リソース」をクリックしてレコードIDを入れるリソースを作っていく
    • リソース種別:変数
    • API参照名:recordId
    • データ型:テキスト
    • 複数の値を許可:チェックなし
    • デフォルト値:なし
    • フロー外部での可用性:「入力で使用可能」にチェック
  3. これでreocrdIdという変数に取得したいIDが入ってくるのでこれを使ってレコードを取得する。例えばこんな感じスクリーンショット 2022-03-08 9.46.02.png

うーん。
ヘルプに書いてある通りって言えばそうなんだけどわからんよな〜。というメモ。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?