SalesForce.com - 报告审批流程变通办法

发布于 2024-10-08 07:29:15 字数 238 浏览 9 评论 0原文

我试图解决的问题是我们无法报告待审批的情况。

我看到建议我们更新在每个步骤之后执行的操作中路由的对象上的字段 - 但是,当该步骤用于并行批准时,这不起作用。

我一直无法找到一个可以附加触发器的对象,该触发器会在每个人批准后触发。

归根结底,我需要能够生成一份关于谁需要批准什么的报告(我知道每个人都会在他们的主页上看到他们需要批准的内容,我需要其他人能够提取报告所有待批准的事项)。

有什么想法吗?

The problem that I'm trying to workaround is that we cannot report on pending approvals.

I've seen the recommendation that we update fields on the object that is being routed in the action that executes after each step - however this doesn't work when the step is for parallel approvals.

I haven't been able to find an object I can attach a trigger to that would fire after each person approves.

At the end of the day I need to be able to product a report of who needs to approve what (I am aware that each person will see what they need to approve on their homepage, I need others to be able to pull a report on all the pending approvals).

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

弃爱 2024-10-15 07:29:15

由于我确实需要任何人都能够在任何给定时间检查所有待批准或特定用户的待批准,因此我创建了一个 VisualForce 页面并使用以下查询,具体取决于查找每个待批准或用户的待批准。

对于所有待批准的批准:

[SELECT Status, TargetObject.Name, TargetObjectId, TargetObject.Type, (SELECT Actor.Id, Actor.Name, Actor.Email, CreatedDate FROM WorkItems)
                                    FROM ProcessInstance
                                    WHERE TargetObject.Type = 'ObjectICareAbout__c' and Status='Pending']

对于给定用户的待批准的批准:

[SELECT ActorId, Actor.Name, Actor.Email, CreatedDate, ProcessInstance.Status, ProcessInstance.TargetObjectId, ProcessInstance.TargetObject.Name
                                            FROM ProcessInstanceWorkitem
                                            WHERE ActorId = :user AND ProcessInstance.Status = 'Pending' AND ProcessInstance.TargetObject.Type = 'ObjectICareAbout__c']

然后将这些批准映射到公共视图模型以显示在 VF 页面中。

Since I really needed for anyone to be able to check all pending approvals or pending approvals for a particular users at any given time I created a VisualForce page and used the below queries depending on looking for every pending approval or ones for a user.

For all pending approvals:

[SELECT Status, TargetObject.Name, TargetObjectId, TargetObject.Type, (SELECT Actor.Id, Actor.Name, Actor.Email, CreatedDate FROM WorkItems)
                                    FROM ProcessInstance
                                    WHERE TargetObject.Type = 'ObjectICareAbout__c' and Status='Pending']

For pending approvals for a given user:

[SELECT ActorId, Actor.Name, Actor.Email, CreatedDate, ProcessInstance.Status, ProcessInstance.TargetObjectId, ProcessInstance.TargetObject.Name
                                            FROM ProcessInstanceWorkitem
                                            WHERE ActorId = :user AND ProcessInstance.Status = 'Pending' AND ProcessInstance.TargetObject.Type = 'ObjectICareAbout__c']

These are then mapped to a common view model to displayed in the VF page.

公布 2024-10-15 07:29:15

首先也是最重要的 - 转到报告 ->行政报告->所有待批准的请求

检查一下,看看是否可以对其进行微调以满足您的需求。如果您需要能够与非管理员共享它 - 考虑用它制作一个仪表板(可以是表格)并安排它每天运行和运行。电子邮件发送...

如果您觉得仍然需要解决方法 - 我们当然可以尝试

但是,当该步骤用于并行批准时,这不起作用

您是否尝试过在更新中使用公式?像 someHiddenNumberField +1 这样的东西可能会起作用(我目前无法在我的开发版本中测试它);如果不是直接这样,那么可以使用一些语法糖,例如 PRIORVALUE()。或者甚至更好 - 有一个文本字段并在其中附加日期/时间+批准者。然后在最后一步中清除“计数器”并完成。

如果基于公式的更新的技巧不起作用(没有承诺,这只是一个想法),那么也许保留设置特殊字段的旧方法,但也在此对象上定义“更新前”触发器(或工作流程?但那就是又是一个公式),它将检查值,更新“计数器”并将隐藏字段设置回原始值。

First and foremost - go to Reports -> Administrative Reports -> All pending approval requests.

Check it out and see if it can be fine-tuned to match your needs. If you need to be able to share it with non-admins - consider making a dashboard out of it (can be Table) and schedule it for daily run & email sending...

If you feel you still need a workaround - we can certainly experiment with

however this doesn't work when the step is for parallel approvals

Have you tried using formulas in the update? Stuff like someHiddenNumberField +1 might work (I can't test it in my Dev edition at the moment); if not directly like that then with some syntactic sugar like PRIORVALUE(). Or maybe even better - having a text field and appending in it date/time + who approved. Then in last step you clear the "counter" and are done.

If trick with formula-based updates will not work (no promises, it's just an idea) then maybe keep the old way of setting special field but define also a "before update" trigger on this object (or workflow? but that's again a formula) that will check value, update "counter" and set the hidden field back to original value.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文