Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

We have a complex form build on top of a set of xsd files.

The form is used as the association and initiation form of a custom visual studio workflow.

Everything was working as expected on the 2007 platform.

Now, the platform has been migrated to the 2010 version. But the boolean field stopped to works. In fact, the HTML dom of the generated form has explicitely the disabled attribute on the generated checkbox :

<SPAN style="WHITE-SPACE: nowrap" class="a1_8F0mPmkZMpYOqfxX_0 j_8F0mPmkZMpYOqfxX_0 a2_8F0mPmkZMpYOqfxX_0" onmouseover="return LeafControl.OnWrappingSpanMouseOver(this, event);" onmouseout="return LeafControl.OnWrappingSpanMouseOut(this, event);">
    <INPUT disabled onblur="return (CheckBox.OnBlur(this, event));" id=ctl00_PlaceHolderMain_XmlFormControl_V1_I1_C5 class="a0_8F0mPmkZMpYOqfxX_0 m_8F0mPmkZMpYOqfxX_0" onfocus="return (CheckBox.OnFocus(this, event));" title="" tabIndex=0 value="" type=checkbox OriginalId="V1_I1_C5" FormId="ctl00_PlaceHolderMain_XmlFormControl" ViewDataNode="6" direction="ltr" wrapped="true" ScriptClass="CheckBox">
</SPAN>

What can cause this boolean field to be disabled???

FYI, the boolean field is part of an XSD schema :

<xsd:schema targetNamespace="http://schemas.corporate.com/moss/common/shortwfschema" xmlns:shortwf="http://schemas.corporate.com/moss/common/shortwfschema" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
     <xsd:element name="Shortwf" type="xsd:boolean">
     </xsd:element>
</xsd:schema>

It then has been imported in the form by using "Add new"-->"Import complete xml schema" on the root of the form schema.

This resulted in the apparition of the field shortwf:Shortwf in my main form.

Then I've added a simple checkbox, bound to this field (I've also try with other kind of controls, with no success).

enter image description here

I've also tried to create a section, bound to this field, but the section does not even appears.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

Can't explain why, but if I remove the workflow association, and if I re-associate it, the boolean field started to works correctly.

The only major drawback of this technique is that I loose all the workflow history

Edit: I find the actual root of the issue, and was able to fix it.

The workflow has been updated last year. This update introduced the new boolean field.

However, the workflow association data did not included this boolean field (in its xml definition). This caused InfoPath 2010 to ignore this field and disable the checkbox.

So the actual workaround was to "patch" the association data to include the desired value of this field. I've played a bit with PowerShell:

# Get the workflow association (in my case, the only workflow on my library)
$web = Get-SPWeb http://server/sites/web
$lib = $web.Lists["My Library"]
$wf = $lib.WorkflowAssociations[0]

# patch the association data
$wf.AssociationData = $wf.AssociationData.Replace("</otherfield>","</otherfield><shortwf:Shortwf>false</shortwf:Shortwf>")

# save it
$lib.WorkflowAssociations.Update($wf)

The association update is not very academic, but it's a one shot script and that was enough in my case.

I believe I should have created a new v2 workflow, in order to maintain the old workflow instances but I was lucky enough to be able to stop all running workflows

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.