我有一个BQL,它为特定分支选择Branch.BAccountID。接下来,我使用Search方法,使用BranchMaint图形。当我抛出PXRedirection异常时,系统会打开分支维护屏幕。不幸的是,屏幕没有导航到分支记录。屏幕的行为类似于它希望输入新的分支记录。使用debug,我注意到graph.BAccount.Current等于NULL。奇怪的是,搜索方法找不到正确的分支记录
BranchMaint graph = new BranchMaint();
Branch b = PXSelect<Branch, Where<Branch.branchID, Equal<Required<Branch.branchID>>>>.Select(this, this.Assessment.Current.ReceiveBranchID);
if (b!=null)
{
graph.BAccount.Current = graph.BAccount.Search<Branch.branchID>(b.BranchID);
throw new PXRedirectRequiredException(graph, "Redirect");
}
答案 0 :(得分:2)
我找到了答案......
Branch branch = PXSelect<Branch, Where<Branch.branchID, Equal<Required<Branch.branchID>>>>.Select(this, this.Assessment.Current.ReceiveBranchID);
BranchMaint.BranchBAccount branchRow = PXSelect<BranchMaint.BranchBAccount,
Where<PX.Objects.CS.BranchMaint.BranchBAccount.branchBranchCD,
Equal<Required<PX.Objects.CS.BranchMaint.BranchBAccount.branchBranchCD>>>>.Select(graph, branch.BranchCD);