Workflow using custom InfoPath Task Form can't access Extended Properties from ItemMetaData.xml
-
2012年4月13日 23:01
I have a custom task form working in InfoPath and am able to set values using the ItemMetaData.xml file. However trying to access Values from the AfterProperties of the task is returning an empty string.
So my steps are:
I add the extended property when creating the task:
private void CreateApprovalTask_MethodInvoking(object sender, EventArgs e) { approvalTaskId = Guid.NewGuid(); approvalTaskProperties.TaskType = 0; approvalTaskProperties.SendEmailNotification = true; approvalTaskProperties.ExtendedProperties.Add("Technical_Input", "Test Value");
Add the property to the ItemMetadata.xml:
<?xml version="1.0" encoding="utf-8"?> <z:row xmlns:z="#RowsetSchema" ows_Technical_Input="" />
Test it in the Form, it works just fine:
But when I debug and access the value from the Extended After Property, i'm getting an empty string instead of the user's input:
private void onTaskChanged1_Invoked(object sender, ExternalDataEventArgs e) { string TechnicalInput = this.approvalTaskAfterProperties.ExtendedProperties["Technical_Input"].ToString();Has anyone ever experienced this?
- 已移动 Emir LiuMicrosoft Contingent Staff, Moderator 2012年4月16日 8:35 SharePoint 2010 programming problem (From:SharePoint 2010 - Using SharePoint Designer, Infopath, and other customization)
全部回复
-
2012年4月17日 2:47版主
Hi Omar,
For the ExtendedProperties, the hash table contains a GUID and a value, use the name of the field will not work, please try to get the ID of the field first, then get the value using ExtentedProperties[fieldID].
System.Guid fieldID = workflowProperties.TaskList.Fields[“fieldname”].Id;
Thanks,
QiaoQiao Wei
TechNet Community Support
-
2012年4月17日 13:20
Thanks Qiao. That didn't seem to work in the OnTaskChanging Event.
I Eventually found the problem: SharePoint wouldn't write back to the ItemMetaData Fields unless they were in the Root of the InfoPath Form. Fields in Folders don't seem to bind.
- 已标记为答案 Qiao WeiMicrosoft Contingent Staff, Moderator 2012年4月26日 9:38
-
2012年4月26日 21:42Thanks Omar. I was having the same issue and this solved it.
C#, Sharepoint

