I'm just writing a function that will accept the workflowID, the form name, the Attribute name, and then the new attribute value, and it will process accordingly. The code is pretty standard, but I highlighted the section where I'm not sure how to identify if my attribute type is a text field or a multiline. I was thinking that I could check to see if the value field is an array (which seems to indicate a multiline), but when the multiline field has no value in it, the "value" field is empty. I'm just thinking there's probably an easy way to determine the difference that I'm missing? Here's basically what my code is doing, along with the what I would have thought would be where I could identify the type. Thoughts?
//get the definition of the references workflow id
ProcessInstance ProcessInstance; ProcessInstance = wfsc.GetProcessStatus(ref otAuth, workflowID, workflowID);
//get the form data
FormData wfFormData = new FormData();
wfFormData = ((FormData)(wfData[3]));
FormDataInstance[] fdList = wfFormData.Forms;
//loop through and find the correct form name that matches
foreach (FormDataInstance f in fdList)
{
if (f.Name == formName)
{
//one the form name is found, get the attribute data
AttributeGroupDefinition agd = new AttributeGroupDefinition();
agd = f.Data;
//loop through the attributes until you find the name that matches
for (int i = 0; i < agd.Attributes.Length; i++)
{
if (agd.Attributes[i].DisplayName.ToUpper() == attrName.ToUpper())
{
//****now that I have the attribute, I need to be able to determine if it's a multiline text field or just a string, so that I can do something like this:
if (agd.Attributes[i].TYPE? == "String")
{
StringAttribute sAttr = (StringAttribute)agd.Attributes[i];
}
else <Type woud be equal to a multline>
{
MultiLineAttribute mAttr = (MultiLineAttribute)agd.Attributes[i];
}
//**End my confusion
}
}
}
}
Without a value: with a value:
