Configuring Field Rules via LoadXML

The background color of a field to be settable via LoadXML method, as well as other field attributes that were only configurable via AddFieldToForm method. The list of configurable attributes includes:

  • FieldBackgroundColor
  • RequiredByField
  • RequiredByFieldValues
  • SemiRequired
  • AttachTitle
  • AttachFile
  • RegEx

New XML Schema

<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:element name="ParentField">
		<xs:complexType>
			<xs:sequence maxOccurs="unbounded">
				<xs:element name="Field">
					<xs:complexType>
						<xs:all>
							<xs:element name="FieldName" type="xs:string" minOccurs="1" nillable="false"/>
							<xs:element name="FieldValue" minOccurs="0" type="xs:string" nillable="true"/>
							<xs:element name="FieldReadOnly" minOccurs="0" type="xs:boolean" nillable="true"/>
							<xs:element name="FieldVisibility" minOccurs="0" type="xs:integer" nillable="true"/>
							<xs:element name="FieldRequired" minOccurs="0" type="xs:boolean" nillable="true" />
							<xs:element name="FieldFormat" minOccurs="0" type="xs:string" nillable="true"/>
							<xs:element name="FieldMask" minOccurs="0" type="xs:boolean" nillable="true"/>
							<xs:element name="FieldCalcOverride" minOccurs="0" type="xs:boolean" nillable="true" />
							<xs:element name="HiddenField" minOccurs="0" type="xs:boolean" nillable="true"/>
							<xs:element name="FieldBackgroundColor" minOccurs="0" type="xs:string" nillable="true"/>
							<xs:element name="RequiredByField" minOccurs="0" type="xs:string" nillable="true"/>
							<xs:element name="RequiredByFieldValues" minOccurs="0" type="xs:string" nillable="true"/>
							<xs:element name="SemiRequired" minOccurs="0" type="xs:boolean" nillable="true"/>
							<xs:element name="AttachTitle" minOccurs="0" type="xs:string" nillable="true"/>
							<xs:element name="AttachFile" minOccurs="0" type="xs:boolean" nillable="true"/>
							<xs:element name="RegEx" minOccurs="0" type="xs:string" nillable="true"/>
						</xs:all>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>

Sample Code

  1. To apply a red background color to field 1own.FName, a valid XML looks like the following:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?><ParentField><Field><FieldName>1own.FName</FieldName><FieldBackgroundColor>#ff0000</FieldBackgroundColor></Field></ParentField>

    VB.NET
    objQFE.LoadXML("<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes""?><ParentField><Field><FieldName>1own.FName</FieldName><FieldBackgroundColor>#ff0000</FieldBackgroundColor></Field></ParentField>")

    C#
    objQFE.LoadXML("<?xml version=\"1.0\" encoding="\UTF-8\" standalone=\"yes\"?><ParentField><Field><FieldName>1own.FName</FieldName><FieldBackgroundColor>#ff0000</FieldBackgroundColor></Field></ParentField>")


  2. To make 1own.FName field Semi Required, a valid XML looks like the following:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?><ParentField><Field><FieldName>1own.FName</FieldName><SemiRequired>true</SemiRequired></Field></ParentField>

    VB.NET
    objQFE.LoadXML("<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes""?><ParentField><Field><FieldName>1own.FName</FieldName><SemiRequired>true</SemiRequired></Field></ParentField>")

    C#
    objQFE.LoadXML("<?xml version=\"1.0\" encoding="\UTF-8\" standalone=\"yes\"?><ParentField><Field><FieldName>1own.FName</FieldName><SemiRequired>true</SemiRequired></Field></ParentField>")

For help regarding Quik! Forms and the Quik! API
Email: support@quikforms.com | Phone: (877) 456-QUIK