LoginSignup
2
0

Flowに関するまとめページ

Last updated at Posted at 2022-05-29


Apexでは編集不可項目には代入ができないようになっていて、フローでもそれは同じです。
Apexで編集不可を含めて全ての項目をSOQLで取得してINSERTを行ったとしても、IDを空にしておけばエラーにはなりません。
フローではIDを空にしなくても、レコードの作成要素ではIDが無視されます。

選択的に省くというよりも、省かなくてもDMLの際のロジックで上書きされるという感じです。

決定要素で条件と違う場合でかつ、デフォルトの結果がなければ、フローはそこで止まるみたいにことが回答されています。

If the default outcome doesn't point to anything and none of the other choices are true the flow should stop.

https://www.reddit.com/r/salesforce/comments/jx9fmn/how_flow_default_outcome_works/

Did you resolve this? I'm having the same issue. It's there in the sandbox and working but in Production it's not an option. Thanks

I don't know if your flow is an screen flow or any other kind. However, I was facing the same issue and I found out that in prod environment it's not possible according to this article (specifically when it mentions "Debugging a flow as another user is available only for screen flows and autolaunched flows in nonproduction orgs."):

Link

So I had to "debug" my screen flow in prod environment (to reproduce the same issue that I was facing in sandbox environments) using a non-admin test user and changing the layout and adding the necessary elements to invoke it.

https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000A98wASAR

Please check this article.

Flow - Create a flow that updates the discount email sent tickbox automatically when the date the email was sent field is filled in.
https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000QKHDKSA5

レコード更新要素内の[関連レコードを更新]とは、「関連先に商談が紐づいている前提」のようでした。

今回の原因は、私共の組織では活動オブジェクトにカスタム項目として[商談]を作成しておりました。そのカスタム[商談]をToDoに使用しており、[関連先]には別のレコードを充てていました。

そのことが原因だったので、[関連レコードを更新]ではなく[該当レコードの詳細を設定]では更新ができました。

数式

ISCHANGED({!$Record.Supplier_id__c})

As you may know, Salesforce limits the Record Choice Set and Picklist Choice Set to 200 items. For complex use-cases involving a long list of records, use the Collection Choice Set.

https://crmbrew.com/salesforce-flow-choice-lookup-component/

Nullの時の判定

Account_Field__c   >  IsNull  >  {!$GlobalConstant.False}

サブフロー

I was able to resolve my issue. I ended up rebuilding my subflow as an Autolaunched Flow since that is something that cannot be changed after a subflow is created. It was an obvious mistake by me.

問題を解決できました。サブフローの作成後に変更できないものであるため、サブフローを自動起動フローとして再構築することになりました。それは私の明らかな間違いでした。

作成例

できない例

フローを使って承認、却下する機能はアイデアにはあがっているようです。

Approve or Reject records through Process builder or Flow
https://ideas.salesforce.com/s/idea/a0B8W00000GdcOtUAJ/approve-or-reject-records-through-process-builder-or-flow

以下でもApexを使っていますね。
https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000HESplSAH

その他

移行ツールの制限

image.png

リストビューで使うフロー

One caveat to Matt's suggestion: your list button must be configured to "Display in existing window without sidebar or header" for this to work. This is exactly how the setup is shown in the screenshot on the page above, but pointing it out here to avoid others wasted time from overlooking that part of the button setting.

How can I pass selected records from a listview into a flow?

私の設定では「 現在のウィンドウにサイドバーなしで表示 」を指定していて機能しませんでした。
上記に書いていある「現在のウィンドウにサイドバーおよびヘッダーなしで表示」ではなんと機能します。

lightning:availableForFlowScreens を使ってオブジェクトにリダイレクトさせる?

When a flow is run from Flow Builder or a direct flow URL (https://yourDomain.my.salesforce.com/flow/MyFlowName), force and lightning events aren’t handled.

I don't think redirects work with this lightning:availableForFlowScreens option.
Consider if you can use the following Or I think there is no choice but to implement everything with custom components.

the Run an Autolaunched Flow from a Custom Button unit

I found it....it was my mistake and I kept missing it everytime I was checking the individual steps. I had created a Detail Page Link and not a Detail Page Button, that's why it wasn't showing. So sorry but maybe someone else will run into the same issue at some point and can learn from my mistake :)

私はそれを見つけました....それは私の間違いであり、個々のステップをチェックするたびに見逃していました.詳細ページ ボタンではなく詳細ページ リンクを作成したため、表示されませんでした。申し訳ありませんが、他の誰かがいつか同じ問題に遭遇し、私の過ちから学ぶことができるかもしれません:)

非同期実行パスでRecord_Priorの値を参照する方法

英語ですが同じ質問があります。

対応しないので、以前の値は別途別のフィールドとして持っておくようなことが回答されています。

As of the time of this answer, you cannot use PRIORVALUE or $Record__Prior in an Asynchronous Path and see the values before the path executes. This is being considered for Run Asynchronously, but not for Scheduled Paths.

If you need to check what the prior value was, you need to make separate arrangements for this, such as saving the previous value in a different field or record. This question has an answer that explains it:

Obtaining Prior Record Values Using Asynchronous Flows
https://salesforce.stackexchange.com/questions/372536/obtaining-prior-record-values-using-asynchronous-flows

フローを使って複数の招待者を登録する

EventRelationオブジェクトを使うようなことが回答されています。

https://trailhead.salesforce.com/ja/trailblazer-community/feed/0D54S00000A8pmhSAB

Apexを使う

Apexの戻り値の変数設定はどうなっていますか?

例えばテキスト型のコレクション変数として返す場合にはList>のように2重にList型として定義しないと機能しません。不思議です。

global class MultiSelectFlowValues {
   @InvocableMethod
   public static List<list<string>> CheckValues(List<string> values) {
      if(!(values.isEmpty())){
         ist<list<string>> finalLst = new list<list<string>>();
         for (String tStr : values) {
             List<String> lstnew = tStr.split(';');
             l
             finalLst.add(lstnew);
         }
         return finalLst;
      }
      else return null;
   }
}

ダミーのIdを使えるならば、もう一つBoolean型の変数を作って、この変数がtrueの時は実際にはダミーのIdを使わずに新規作成した取引先のIdを使うように処理できると思います。

メール関係

外部認証

Yes, I was trying to create an HTTP callout. The solution I found is to run it in an asynchronous path.

FYI, in that case, you need to specify the input condition as a formula and also check "Only if the record is updated to meet the condition requirements". It's a little difficult to solve.

はい、HTTPコールアウトを作成しようとしていました。私が見つけた解決策は、非同期パスで実行することです。

参考までに、その際には、入力条件を数式として指定し、「条件要件を満たすためにレコードが更新された場合のみ」にもチェックを入れる必要があります。解決するのは少し難しいです。

2
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
2
0