I encountered an issue when assigning a multi-user data to a workflow task field from within the workfflow.
There may be various reasons anyone wants to create a User/Group field with multiple values and set it within in the workflow as below,
SPWorkflowTaskProperties.ExtendedProperties["CustomAssignToUsers"] = "domain\user1;domain\user2";
SharePoint checks the property collection and strips off the multiple user data from the property for type SPFieldUser.
As a workaround, we can create a custom field which inherits from the SPFieldUser, this new field type bypass the control type checks within SharePoint.
Save the second markup as ‘FLDTYPES_MyCurrentUserField.xml’ and paste it under ..\12\TEMPLATE\XML folder
Build an assembly using the code snippet provided below, strong name it.
Ensure that you change the ‘FLDTYPES_MyCurrentUserField.xml’ according to the binary version and the publictokenkey.
Custom Field Types
Create a custom field type and a field Control