Announcement

As of April 17, 2018, this site is now in read-only mode. To start new Blackbaud Developer’s discussions, you will find Developer Discussions in the Blackbaud CRM Community.

To post or respond to Blackbaud Community discussions, you will have to login using a www.blackbaud.com login. Learn how to login here. If you have questions or need assistance, please email community@blackbaud.com.

1.7k questions

3.2k answers

401 users

Categories

1.7k questions

3.2k answers

401 users

I have the below collection field in a view dataform inside a UIWidget, I am trying to get xml for it, but it comes up empty, where as the same code works when I am using inside a report spec. Any insights on why its not working with view data form

<FormField FieldID="AVAILABLEFIELDS" Caption="Fields" Hidden="true">
            <Collection>
               <Fields>
                  <FormField FieldID="COLUMNNAME" DataType="String" Caption="Column name" Hidden="true" />
                  <FormField FieldID="NAME" DataType="String" Caption="Display name" />
                  <FormField FieldID="ISSELECTED" DataType="Boolean" Caption="Is selected" Hidden="true" />
                  <FormField FieldID="ID" DataType="Integer" Caption="ID" Hidden="true" />
               </Fields>
            </Collection>
         </FormField>

Here is the vb code I am using

AVAILABLEFIELDS.ToDataFormItemArrayValue().ToCollectionFieldXml
(AVAILABLEFIELDS.Name, GetCollectionFieldDescriptor(AVAILABLEFIELDS))

output

  <AVAILABLEFIELDS>
    <ITEM />
    <ITEM />
    <ITEM />
  </AVAILABLEFIELDS>

output with report spec

<AVAILABLEFIELDS>
    <ITEM>
        <ID>1</ID>
        <NAME>Lookup id</NAME>
    </ITEM>
    <ITEM>
        <ID>2</ID>
        <NAME>Key/Last name</NAME>
    </ITEM>
    <ITEM>
        <ID>3</ID>
        <NAME>First name</NAME>
    </ITEM>
</AVAILABLEFIELDS>
asked by sakiti (134 points)

Does the AVAILABLEFIELDS property contain elements when you debug it?

Yes, the value and valueobject contain all the elements and values, but I noticed ToDataFormItemArrayValue() only contains empty elements.

1 Answer

I found the issue, since the fields are read only in the view form need to pass in true to include read only values

AVAILABLEFIELDS.ToDataFormItemArrayValue(True).ToCollectionFieldXml
(AVAILABLEFIELDS.Name, GetCollectionFieldDescriptor(AVAILABLEFIELDS))
answered by sakiti (134 points)
...