SharePoint Designer - Workflow

另外一篇文章 SharePoint 2013 - Designer Workflowhtml

 

1. Set field in current item : 不要連續屢次使用,不然在發佈時會出現unexpected error;當須要同時更新幾個字段時,使用update list item。app

2. Error:ide

  (1)Errors were found when compiling the workflow. The workflow files were saved but cannot be run. Unexpected error on server associating the workflow。ui

--------http://support.microsoft.com/kb/2557533this

3. Wait for Field Change in Current Item: 可以使用此活動將工做流停頓在某一步;spa

4. 獲取InfoPath的文件名(含擴展名)時,能夠用 'Name (for use in forms)',或者Title屬性,但不要使用Name屬性,由於Name屬性不包含擴展名;3d

5. Email 模板code

<head><style>TABLE.mail { border-style:none; border-collapse:collapse; font:8pt Tahoma; width:100%; }TD.header { background:#F8F8F9; border:1px solid #E8EAEC; padding:12pt  10px 4pt 10px; }TD.body { padding:12pt 10px 24pt 10px; }TD.footer { border-width:1px; border-style:solid none none none; border-color:#9CA3AD; padding:4pt 10px 4pt 10px; }A {  text-decoration:none; }DIV.title { font:16pt Verdana; }DIV.headertext { margin:5px 0px 0px 0px; }DIV.error { font-weight:bold; }DIV.comment { color:#9CA3AD; }SPAN.wfname {  font:bold italic; }.headertop1 {  width: 100%;}.headercontent {  color: #000000;  font-family: verdana;  font-size: 16pt;}.headercontent em {  font-weight:bold;}.breadcrumb td {   padding-left: 2px;  padding-right: 2px;}.breadcrumb a{  font-family: tahoma;  font-size: 8pt;}.content {  margin-top:6px;  width: 100%;  border-bottom:solid 1px #9ca3ad;}.toolbar {   border: 1px solid #e8eaec;  background-color: #f8f8f9;  padding-top:3px;  padding-bottom:6px;  padding-right:3px;  padding-left:3px;}.toolbarbutton a, .toolbarsep {  font-family:  verdana;  font-size: .68em;  padding-left: 3px;  padding-right: 3px;}.toolbarbutton a{  text-decoration: none;}.toolbarsep {  color:#c7cbd1;}.spacer {    height: 10px;  font-size: 1px;   line-height: 1px;}.formline,  .noheight {  height: 1px;  font-size: 1px;  line-height: 1px;}.formlabel, .formbody, .digestlabel, .altdigestlabel, .deletedlabel, .altdeletedlabel  {  font-family:  tahoma;   font-size:8pt;   padding: 0px 7px 0px 7px;  vertical-align: top;}.formlabel, .digestlabel, .altdigestlabel, .deletedlabel, .altdeletedlabel  {  color: #616a76;  font-weight: bold;  }.rulerow  {  border-bottom:solid 1px #9ca3ad;  height:0px;  font-size:1px;  line-height:0px;}.digestlabel a, .altdigestlabel a {}.digestlabel a:hover, .altdigestlabel a:hover {}.formbody {   color: #000000;}.edited{  text-decoration:line-through;  color:#9ca3ad;}.descriptiontext {  color: #9ca3ad;  font-family: tahoma;   font-size: 8pt;   padding-top:5px;  padding- bottom:7px;}.formline {  border-bottom: 1px solid #D7DEAC;}.editedicon, .newicon, .deletedicon {  color:#000000;  font-family: Small Fonts,  Tahoma, Verdana, Sans Serif;  font-size:  7pt;  padding-top:0px;  padding-right:3px;  padding-bottom:1px;  padding-leftt:2px;  position: relative;  top:2px;  margin-right:8px;  margin-left:8px;  font-weight:normal;}.editedicon {   background-color:#ffffcc;}.newicon {  background-color:#b1faa2;}.deletedIcon {  background-color:#ffcccc; }.messagespace {  color: #5D6437;  font-family: tahoma;   font-size: 8pt;    padding-top:5px;  padding-bottom:7px;}.editedexample {  background: #FFFFBF;  padding:1px;}.vh, .vb, .altvb, .deleted, .altdeleted{  font-weight: normal;  text-align: left;   text- decoration: none;   vertical-align: top;  font-size: 8pt;    font-family: tahoma, sans-serif;  padding-left:  5px;   padding-right: 8px;}.vb, .altvb, .deleted, .altdeleted, .digestlabel,  .altdigestlabel, .formlabel, .formbody {  border-bottom:solid 1px #e8eaec;  padding-top:2px;  padding-bottom:5px;}.vb div.nobr, .altvb div.nobr {  white-space:nowrap;}.vh {   color:#76808e;  font-weight:bold;  padding-top:7px;  padding-bottom:6px;  white-space:nowrap;}.vb, .altvb {  color:#616a76;}.altvb, .altdigestlabel, .altdeleted, .altdeletedlabel,  .formlabel, .formbody {  background: #f8f8f9; }.digesttext {  color: #000000;}.deleted, .deletedlabel, .altdeleted, .altdeletedlabel {  text-decoration: line-through;   color:#9ca3ad;}.deleted a, .altdeleted a {  color:#9ca3ad;  text-decoration:line-through;}</style></head><body><table cellpadding="2" cellspacing="0" class="mail" DIR="none"><tr  class="header"><td class="header"><div class="title"><font size="2">[%Current Item:申請人姓名%],您好。<br><br>您借的產品 <a href="[%Public_Values:.../DispForm.aspx?ID=[%Current Item:ID%]">[%Current Item:產品名稱%]</a> 已經到期,請儘快歸還。謝謝配合! </font></div></td></tr><tr class="body"><td> </td></tr><tr class="footer"><td class="footer"></td></tr></table><table class="content" cellspacing="0" cellpadding="0"><tr><td  colspan=3 class="descriptiontext">  Detailed Information</td></tr><tr><td class="formlabel"><font size="2">產品名稱</font></td><td class="formbody"><font size="2"> [%Current Item:產品名稱%] </font></td><td class="altvb"> </td></tr><tr><td class="formlabel">Product Category:</td><td class="formbody"><font size="2">  [%Current Item:Product Category%] </font></td><td class="altvb"> </td></tr><tr><td class="formlabel"><font size="2">開始日期:</font></td><td class="formbody"><font size="2"> [%Current Item:開始日期%] </font></td><td class="altvb"> </td></tr><tr><td class="formlabel"><font size="2">結束日期:</font></td><td class="formbody"><font size="2">[%Current Item:結束日期%] </font></td><td class="altvb"> </td></tr><tr><td colspan=3 class="descriptiontext">  Last Modified [%Current Item:Modified%]</td></tr></table></body>

  界面爲:orm

 

6. 在同一站點下將含有工做流的文檔庫或列表保存爲模板並新建,工做流也會存在於新建的Library/List中,但能夠再List Settings的Workflow Setting中移除工做流和列表的關聯,並且不會影響到原有的列表;server

7. SharePoint 2013 Workflow中的Start a List Workflow 和 Start a Site Workflow都只能用於啓動SharePoint 2010 Workflow,但主工做流會等待子工做流結束後再往下繼續運行;

8. List Form中的People Picker控件,若是不填任何信息,直接使用這個字段發郵件(CC中),會出錯;但Library Form中的People Picker字段,若是不填任何信息,直接在郵件抄送中使用,不會出錯;

Library Form中的People picker容許多選時,獲得的account是 域名\登陸名 的格式,在郵件中使用時不能驗證;但單選時不會出現這個問題;可是儘可能不要使用帶有域名的帳號去發郵件;

9. 在使用 Start Approval Process 生成審批任務時,須要對其進行修改,使其更合理,通常會對任務郵件內容進行修改,刪除其它郵件,具體可參考此處

10. 郵件格式可參考如下內容:

<head><style>TABLE.mail { border-style:none; border-collapse:collapse; font:8pt Tahoma; width:100%; }TD.header { background:#F8F8F9; border:1px solid #E8EAEC; padding:12pt  10px 4pt 10px; }TD.body { padding:12pt 10px 24pt 10px; }TD.footer { border-width:1px; border-style:solid none none none; border-color:#9CA3AD; padding:4pt 10px 4pt 10px; }A {  text-decoration:none; }DIV.title { font:16pt Verdana; }DIV.headertext { margin:5px 0px 0px 0px; }DIV.error { font-weight:bold; }DIV.comment { color:#9CA3AD; }SPAN.wfname {  font:bold italic; }.headertop1 {  width: 100%;}.headercontent {  color: #000000;  font-family: verdana;  font-size: 16pt;}.headercontent em {  font-weight:bold;}.breadcrumb td {   padding-left: 2px;  padding-right: 2px;}.breadcrumb a{  font-family: tahoma;  font-size: 8pt;}.content {  margin-top:6px;  width: 100%;  border-bottom:solid 1px #9ca3ad;}.toolbar {   border: 1px solid #e8eaec;  background-color: #f8f8f9;  padding-top:3px;  padding-bottom:6px;  padding-right:3px;  padding-left:3px;}.toolbarbutton a, .toolbarsep {  font-family:  verdana;  font-size: .68em;  padding-left: 3px;  padding-right: 3px;}.toolbarbutton a{  text-decoration: none;}.toolbarsep {  color:#c7cbd1;}.spacer {    height: 10px;  font-size: 1px;   line-height: 1px;}.formline,  .noheight {  height: 1px;  font-size: 1px;  line-height: 1px;}.formlabel, .formbody, .digestlabel, .altdigestlabel, .deletedlabel, .altdeletedlabel  {  font-family:  tahoma;   font-size:8pt;   padding: 0px 7px 0px 7px;  vertical-align: top;}.formlabel, .digestlabel, .altdigestlabel, .deletedlabel, .altdeletedlabel  {  color: #616a76;  font-weight: bold;  }.rulerow  {  border-bottom:solid 1px #9ca3ad;  height:0px;  font-size:1px;  line-height:0px;}.digestlabel a, .altdigestlabel a {}.digestlabel a:hover, .altdigestlabel a:hover {}.formbody {   color: #000000;}.edited{  text-decoration:line-through;  color:#9ca3ad;}.descriptiontext {  color: #9ca3ad;  font-family: tahoma;   font-size: 8pt;   padding-top:5px;  padding- bottom:7px;}.formline {  border-bottom: 1px solid #D7DEAC;}.editedicon, .newicon, .deletedicon {  color:#000000;  font-family: Small Fonts,  Tahoma, Verdana, Sans Serif;  font-size:  7pt;  padding-top:0px;  padding-right:3px;  padding-bottom:1px;  padding-leftt:2px;  position: relative;  top:2px;  margin-right:8px;  margin-left:8px;  font-weight:normal;}.editedicon {   background-color:#ffffcc;}.newicon {  background-color:#b1faa2;}.deletedIcon {  background-color:#ffcccc; }.messagespace {  color: #5D6437;  font-family: tahoma;   font-size: 8pt;    padding-top:5px;  padding-bottom:7px;}.editedexample {  background: #FFFFBF;  padding:1px;}.vh, .vb, .altvb, .deleted, .altdeleted{  font-weight: normal;  text-align: left;   text- decoration: none;   vertical-align: top;  font-size: 8pt;    font-family: tahoma, sans-serif;  padding-left:  5px;   padding-right: 8px;}.vb, .altvb, .deleted, .altdeleted, .digestlabel,  .altdigestlabel, .formlabel, .formbody {  border-bottom:solid 1px #e8eaec;  padding-top:2px;  padding-bottom:5px;}.vb div.nobr, .altvb div.nobr {  white-space:nowrap;}.vh {   color:#76808e;  font-weight:bold;  padding-top:7px;  padding-bottom:6px;  white-space:nowrap;}.vb, .altvb {  color:#616a76;}.altvb, .altdigestlabel, .altdeleted, .altdeletedlabel,  .formlabel, .formbody {  background: #f8f8f9; }.digesttext {  color: #000000;}.deleted, .deletedlabel, .altdeleted, .altdeletedlabel {  text-decoration: line-through;   color:#9ca3ad;}.deleted a, .altdeleted a {  color:#9ca3ad;  text-decoration:line-through;}</style></head><body><table cellpadding="2" cellspacing="0" class="mail" DIR="none"><tr  class="header"><td class="header"><div class="title"><font size="2">[%Current Task:Assigned To%],您好。<br><br>新的XXXX申請<A HREF="[%Task Process:Web URL%]/[%Task Process:Item URL%]">[%Task Process:Item Title%]</A>等待您的審批。謝謝配合! </font></div></td></tr><tr class="body"><td> </td></tr><tr class="footer"><td class="footer"></td></tr></table><table class="content" cellspacing="0" cellpadding="0"><tr><td  colspan=3 class="descriptiontext">  Detailed Information</td></tr><tr><td class="formlabel"><font size="2">客戶號碼:</font></td><td class="formbody"><font size="2"> [%Current Item:客戶號碼%] </font></td><td class="altvb"> </td></tr><tr><td class="formlabel"><font size="2">客戶所屬大區:</font></td><td class="formbody"><font size="2"> [%Current Item:客戶所屬大區%] </font></td><td class="altvb"> </td></tr><tr><td class="formlabel"><font size="2">Old FIC Code:</font></td><td class="formbody"><font size="2">[%Current Item:Old FIC code%]</font></td><td class="altvb"> </td></tr><tr><td class="formlabel"><font size="2">Update FIC Code:</font></td><td class="formbody"><font size="2"> [%Current Item:Update FIC code%]</font></td><td class="altvb"> </td></tr><tr><td class="formlabel"><font size="2">是否為II類分銷商?</font></td><td class="formbody"><font size="2">[%Current Item:請問是否為II類分銷商?%]</font></td><td class="altvb"></td></tr><tr><td class="formlabel"><font size="2">更新理由:</font></td><td class="formbody"><font size="2"> [%Current Item:更新的理由%]</font></td><td class="altvb"> </td></tr><tr><td colspan=3 class="descriptiontext">  Last Modified [%Current Item:Modified%]</td></tr></table><BR><P class="title"><font size="2">To complete this task:<BR>1. Review <A HREF="[%Task Process:Web URL%]/[%Task Process:Item URL%]">[%Task Process:Item Title%]</A>. <BR>2. Perform the specific activities required for this task.<BR>3. Use the <B>Open this task</B> button to mark the task as completed. (If you cannot update this task, you might not have access to it.)<BR>4. View the <A HREF="[%Workflow Context:Workflow Status URL%]">status</A> of this workflow.</FONT></P></BODY></HTML>
View Code

11. Start Approval Process 能夠有多個任務分配者,可是 Collect data from a user只能設置一個任務接收人;

12. 工做流任務的權限能夠在Advanced Settings中的PermissionSet進行設置,是繼承task列表的權限,仍是隻給任務分配者修改的權限,參考此頁面

另外,若是一個用戶或者一個用戶組不在工做流任務中,但又想讓他進行審批,則能夠將其加入到TaskProcessOwner中去,這樣,他就能夠進行審批,相似於站點管理員能夠對全部task進行審批;

13. 每一個站點SharePoint Designer Workflows都放在一個Workflows列表中,權限繼承自站點,所以若是想使用此工做流,則必須在Workflows列表中有讀取的權限,不然連任務模板(.xsn)都不能訪問,會出現如下錯誤:

a form template file cannot be accessed. you may not have the required permissions to open the file

14. 

相關文章
相關標籤/搜索