sharepoint-2010 - SharePoint 工作流错误 : "Unable to transform the input lookup data into the requested type" BUT only on New Item Creation

标签 sharepoint-2010 sharepoint-designer lookup sharepoint-workflow

仅供引用,我知道如何正确设置查找的更新,并且 99% 的肯定我已经正确地做到了这一点。

我知道这一点是因为当我将工作流程设置为在更改项目时自动启动时,它会完美运行。但是,当我简单地更改此设置以便它在创建新项目时自动启动时,它会取消工作流,并且我得到“强制失败:无法将输入查找数据转换为请求的类型”。如果这两个选项都被选中,那么它在创建时会失败,但只需单击项目属性上的编辑,然后“保存”即可使其工作。

工作流程在文档库上,工作方式如下;

上传后,用户从编辑属性表单的下拉列表中选择工作任务查找,然后保存项目(将其添加到文档库)。假设工作流然后查看选定的工作任务查找,并提取工作任务项具有的帐户和有效日期类型查找 ID,并将文档的相同字段设置为相同的值。

如果有帮助,这是工作流程的代码;

If Current Item: Parent Task is not empty
If Current Item: Sub Task is not empty
    Log Both are empty to workflow history list
    Then Set Account to Work Tasks:Account
    The Log Set Account to workflow history list
    Then Set Effective Date and Type to WorkTasks: Effective Date and Type
    The Log Set EffDateType to the workflow history list

这一切都是一步完成的。我还添加了额外的步骤来测试帐户和生效日期类型字段是否已正确设置,如果没有再次设置。但是每次我在更改时运行工作流并且它工作时,它总是根据第一步(上面发布)正确设置这些字段,并将额外的检查日志记录到不需要它们的历史记录中。

例如,Integer for Tasks:Account 的查找设置为如下工作;
Date Source: Work Tasks (a list)
Field from Source: Account (a lookup)
Return Field as: Lookup ID (as Integer)

Find the List Item
Field: Title (from the Work Tasks list)
Value: Current Item: Parent Task (Which is a look up of the "Title" 
Field from Work Tasks List, and is set to return the Value as a LookUp Value (As Text))

生效日期和类型设置几乎相同。

所以有人有任何见解吗?我尝试将其作为模拟步骤运行,设置工作流程暂停(1 分钟),更改查找类型以防我一开始就搞砸了,但最终上述工作流程确实有效,但只有当我将其设置为“ 自动启动项目的更改(编辑) ”,而不是“ 自动启动新项目创建 ”,就像我需要做的那样。

哦,是的,仅供引用,我在文档库表单的工作任务和子任务字段上使用 SPServices CascadingDropDown,但老实说,我不相信这与我的问题有任何关系。

更新:

我与另一位开发人员交谈过,他认为这是由于工作流程发生得太快的问题,在项目为自己创建 ID 之前,它需要执行查找。他让我在我的工作流程代码的最顶部(在 If 条件之上)添加另一个“暂停工作流程”并将其设置为 1 分钟。

然后它正常工作。

缺点是我们希望标签尽可能接近项目创建。因为图书馆的 View 依赖于基于帐户和生效日期和类型的分组。更令人沮丧的是,微软的暂停工作流程只允许 1 分钟或更长时间,然后用于此的计时器经常关闭,导致暂停时间更长。到目前为止,每项测试目前都显示最少 2 分钟的暂停时间。

即时填充文件的一种可能的替代解决方案是使用 Javascript 和 SPServices 对任务列表进行查找以提取帐户和生效日期类型字段然后填充,但我的 Javascript 不是很强大,我需要帮助这。如果有人有任何建议,我将不胜感激。

最佳答案

(在问题编辑中回答。转换为社区 wiki 答案。见 Question with no answers, but issue solved in the comments (or extended in chat))

OP写道:

I don't know if it is the ID for the item after further testing. I changed the start of the workflow to wait until a field in the item changes. I set it to wait until the ID field is not 0 (since you cannot set to null), and it still does not work.


 6/14/2012 4:13 PM Comment System Account Waiting on ID ​ 
 6/14/2012 4:13 PM Comment System Account Waiting complete on ID ​ 
 6/14/2012 4:13 PM Error System Account Coercion Failed: Unable to transform the input lookup data into the requested type. 

I have tried other fields as well, like document ID value is not empty, and it will wait, log it finishing the wait, and then fail.

UPDATE This issue has something to do with the Parent Task field. I have solved the issue without having to wait for a period of time by setting the change from above to wait until the Parent Task field is not empty. It then completes the workflow fine.

Anyone know why there is a delay though? I've solved it, but still don't fully understand what takes it so long.



主要故障已经解决(因此得到了答案),关于延迟原因的剩余一点可能是一个讨论点,或者对于 SO 来说不够具体。可以在此处编辑任何进一步的说明。

关于sharepoint-2010 - SharePoint 工作流错误 : "Unable to transform the input lookup data into the requested type" BUT only on New Item Creation,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11039005/

相关文章:

java - 如何找到继承给定接口(interface)的类实例?

Ruby 存储查询数据

c# - 托管元数据字段中的 AfterProperties 和 BeforeProperties 根据语言返回不同的字符串

sharepoint - 你如何链接不同站点的 Sharepoint 列表

javascript - 当用户未提交新项目详细信息时,如何捕获新项目详细信息?

sql - 是否有公开可用的机器可读形式的美国州列表?

sharepoint - 部署或应用程序池重新启动后,Sharepoint 2010每用户发送一次错误404

security - 同步 CRM 2011 和 SharePoint 安全性

javascript - Sharepoint 功能区按钮单击未在 I.E 上执行

SharePoint 2007/2010 部署方法