Power Automate Desktop执行JS触发blur事件未触发QuickBooks表单代码的原因?
问题描述
我正在使用Power Automate Desktop的Execute Javascript流程,尝试自动化Quickbooks Online Payroll表单的部分用户输入操作。原生操作该表单时,blur事件会触发数值输入验证等相关逻辑,但通过JS流程更新输入框值后,保存表单时这些输入框会显示为空,表单并未识别到更新的值。因此我认为需要触发blur事件来让数据被表单识别并保存,以下是我的JS脚本:
function ExecuteScript() { var $payrollTableRows = $("table").first().find("tbody > tr.enabled"); var $regHoursInput; var decRegHours; var $bonusInput; var employeeName; console.log('Power Automate: Rows Found: ' + $payrollTableRows.length); $payrollTableRows.each(function(){ employeeName = $(this).find("td:eq(1)").find("a").text(); $regHoursInput = $(this).find("input[wageitemid='HOURLY_PAY']"); if($regHoursInput){ decRegHours = Number($regHoursInput .val()); $bonusInput = $(this).find("input[wageitemid='BONUS']"); $bonusInput.focus(); if($bonusInput){ $bonusInput.val(decRegHours); $bonusInput.trigger('blur'); } } }); }
QB Payroll页面上focus和blur事件触发时执行的脚本截图:
请问为何我脚本中触发的blur事件没有执行这段代码?
更新1
添加页面截图:
更新2
附上我使用的PAD流程,相关操作参考了某视频,循环及循环索引的使用参考了某文章。我的流程截图:
内容的提问来源于stack exchange,提问作者crichavin
相关产品推荐
相关产品推荐

