【解決方法】フローの実行中にインポートファイルの削除ボタンを非表示にするにはどうすればよいですか?


私は Power Apps と Power Automate で働いています。 フォームにインポートファイル要素があります。 ユーザーがファイルをインポートして送信ボタンをクリックすると、フローがトリガーされます。 フローの実行中に、インポートされたファイルの削除ボタンを非表示にしようとしています。

私が試したこと:

JSを試してみましたが、うまくいきませんでした。

JavaScript
function showHideFields(executionContext) {

var formContext = executionContext.getFormContext();
var selectionValue = Xrm.Page.getAttribute("digins_rfpdatafile").getValue().fileName;
console.log(XRM.Page.getAttribute("digins_rfpdatafile").getValue().fileName);
if(selectionValue = "True") {
console.log("True "selectionValue);
formContext.getControl("digins_rfpdatafile.fieldControl-file-control-remove-button").setVisible(true);
}
else {
console.log("False "selectionValue);
formContext.getControl("digins_rfpdatafile.fieldControl-file-control-remove-button").setVisible(false);
}

解決策 1

を使用してそれを行うことができるはずです UpdateContext 関数を使用して、フローのステータスを追跡するコンテキスト変数を作成します。

の中に OnSelect あなたの財産 Submit ボタン:

YAML
UpdateContext({conFlowComplete: YourFlow.Run(parameters).Success})

フローの結果は次のように割り当てられます。 conFlowComplete

の中に DisplayMode ボタンのプロパティ:

YAML
If(conFlowComplete = "Yes", DisplayMode.Edit, DisplayMode.Disabled)

これにより、フローが正しくトリガーされた場合、ボタンが無効になります。

コメント

タイトルとURLをコピーしました