我在脚本中嵌入了以下代码,我可以通过业务逻辑层将记录插入数据库。当我运行脚本时,弹出一个 Win32 对话框并问我一个问题,我回答是。只有在将某些值输入数据库时,才会向用户显示此对话框。所以这只是一个问题的百分比。是否有一个命令可以嵌入到我的脚本中,它会忽略带有默认 Yes 响应的弹出窗口?或者有没有办法让脚本响应并继续处理?在谷歌搜索和搜索这个网站时,我没有看到太多关于这个主题的内容。也许有,我正在搜索错误的短语。如果这不可能,我可以让业务逻辑程序员为我的脚本将运行的角色设置一个例外。
#Process each action required to update the State field
foreach $action (@performAction) {
$entity->EditEntity($action);
#Evaluate for validation errors
$trappedErrorValidate = $entity->Validate();
if ($trappedErrorValidate ne "") {
print ERRFILE "The State field has not been updated from $startState to $finishState for record number @fieldValues[0] due to the error code below.\n";
print ERRFILE "Error Code:$trappedErrorValidate\n";
print ERRFILE "*********************************************************************************\n";
$entity->Revert();
} else {
#Commit and evaluate for errors
$trappedErrorCommit =$entity->Commit();
if ($trappedErrorCommit ne "") {
print ERRFILE "The State field has not been updated from $startState to $finishState for record number @fieldValues[0] due to the error code below.\n";
print ERRFILE "Error Code:$trappedErrorCommit\n";
print ERRFILE "*********************************************************************************\n";
}else {
$stateChanges++;
}
}
}