質問させてください。
新規で取引先オブジェクトが作成された際にある項目(テキスト型)にランダムな8桁の文字列を可能したいと思っております。
実現方法は以下を考えております。
- ランダムな文字列を生成するApexを作成
- フローでオブジェクト作成時をトリガーとしてその項目に対してApexで生成した文字列を格納する
以下のようなランダム文字列を生成するApexを作成しました
global class CreateRandomNumber {
@InvocableMethod
global static List<List<Integer>> getRandomNumber(List<Integer> sizeInput){
List<Integer> randomNumbers = new List<Integer>();
List<List<Integer>> output = new List<List<Integer>>();
for(Integer size : sizeInput){
for(Integer counter = 1; counter <= size; counter++){
Integer rand = Math.round(Math.random() * 1000);
randomNumbers.add(rand);
}
}
output.add(randomNumbers);
return output;
}
}
そしてそれをフローで使用しようとしたのですが、選択肢に上記のApexが出てこず、原因がわかりません...
@InvocableMethodを利用すればフローで利用できると調べたのですが、なぜ出てこないのか解決策を教えていただけますと幸いです。