2013-03-12 57 views
0

我试图通过Sitecore Rocks查询分析器使用Sitecore查询语言将一堆项目更新为新的工作流,同时保持当前状态。我目前有这样的:Sitecore查询语言:更新+其中

update set @#__Workflow state# = "--GUID of the workflow state--" from //*[@@id='--GUID of the parent Item--']/* 

这个工程。我想要做的是包含一个,其中陈述,以便我可以保留草稿/等待批准/批准状态,同时仍然切换工作流程。

update set @#__Workflow state# = "--GUID of the DRAFT workflow state--" from //*[@@id='--GUID of the parent Item--']/* where @#__Workflow state# = "--GUID of the original DRAFT workflow state--"; 
update set @#__Workflow state# = "--GUID of the APPROVED workflow state--" from //*[@@id='--GUID of the parent Item--']/* where @#__Workflow state# = "--GUID of the original APPROVED workflow state--"; 

但是这不起作用。我是否在使用我的时出现语法问题,其中子句或其中未与Sitecore查询语言中的更新一起使用。

回答

1

“Where-clause”在查询语句中不起作用。

你应该使用使用/ * [@字段名= “值”]选择的项目,如:

update set @#__Workflow state# = "--GUID of the DRAFT workflow state--" from //*[@@id='--GUID of the parent Item--']/*[@#__Workflow state# = "--GUID of the original DRAFT workflow state--"]; 

update set @#__Workflow state# = "--GUID of the APPROVED workflow state--" from //*[@@id='--GUID of the parent Item--']/*[@#__Workflow state# = "--GUID of the original APPROVED workflow state--"];