Sharepoint Approval Work Catch批准按钮

【Sharepoint Approval Work Catch批准按钮】天下之事常成于困约,而败于奢靡。这篇文章主要讲述Sharepoint Approval Work Catch批准按钮相关的知识,希望能为你提供帮助。
我在visual studio中创建了Sharepoint Approval 2010工作流程。
如果用户点击批准或拒绝按钮,我该如何捕获?

private void createTaskWithContentType1_MethodInvoking(object sender, EventArgs e) {createTaskWithContentType1_ContentTypeId1 = "0x01080100C9C9515DE4E24001905074F980F93160003A15057E2AF34B67B32E14B94EB70409"; createTaskWithContentType1_TaskId1 = Guid.NewGuid(); createTaskWithContentType1_TaskProperties1.AssignedTo = workflowProperties.Web.SiteAdministrators[0].LoginName; createTaskWithContentType1_TaskProperties1.DueDate = DateTime.Now.AddDays(1.0F); createTaskWithContentType1_TaskProperties1.Title = "Approval Required for xx"; createTaskWithContentType1_TaskProperties1.Description = "Specify the approval result here."; SPList taskList = workflowProperties.TaskList; }private void onTaskChanged1_Invoked(object sender, ExternalDataEventArgs e) { //I think here i have to somehow do:If button approve clicked .... else if reject button clicked }

答案我找到了解决方案
private void onTaskChanged1_Invoked(object sender, ExternalDataEventArgs e) { string taskStatus = onTaskChanged1.AfterProperties.ExtendedProperties["TaskStatus"].ToString();

ExtendedProperties [“TaskStatus”]将返回Approved或Rejected
ExtendedProperties中有更多属性,但您需要进入调试模式才能看到它们。
另一答案您是否创建了自定义任务表单?或OOTB任务表。如果是自定义,则可以直接从自定义任务表单设置值(在保存按钮上)。如果是OOTB,则必须编辑任务表单并添加javscript或JQuery以单击保存按钮。
如果单击“保存”按钮,它将提示。 sharepoint OOTB任务列表表单
function PreSaveItem(){ // add other your codes if(value =https://www.songbingjia.com/android/='confirm'){ return true; // allow save form... }return false; // not allow save form // use return true; if confirm or return false... }

欲了解更多信息,请访问以下链接https://sharepoint.stackexchange.com/questions/117147/how-to-trigger-the-click-event-of-the-sharepoint-ootb-lists-new-form-save-butto

    推荐阅读