如何在流程运行时隐藏导入文件删除按钮?


我在 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をコピーしました