FormLayout.GetDataFieldUsage method
GetDataFieldUsage
DataFieldUsage GetDataFieldUsage(string dataFieldName)
Referenced types: DataFieldUsage
Retrieves the usage of a specific DataField in a FormLayout.
Parameters
| Parameter / type | Description |
|---|---|
dataFieldNamestring |
Name of the DataField to be queried. |
Returns
A DataFieldUsage value describing how the named DataField is used in this FormLayout.
See also
Sample: To query all DataField-objects within a stand-alone FormLayout refer to the code below. The same principle can be used for a Repository-based FormLayout.
// Retrieve the global Project
// A stand-alone FormLayout contains only the global Project, the global Project holds the FormLayout and all DataField definitions
Project project = repository.GlobalProject;
// Retrieve the one and only FormLayout within the stand-alone FormLayout
FormLayout formlayout = project.FirstFormLayout;
// Iterate all DataFields within the Project
DataField datafield = project.FirstDataField;
while (datafield != null)
{
Console.Write(datafield.ToString());
// Retrieve the usage of the DataFields in the FormLayout
switch (formlayout.GetDataFieldUsage (datafield.Name))
{
case DataFieldUsage.Calculated: Console.Write ("--> The value of this DataField is computed within the FormLayout"); break;
case DataFieldUsage.Invalid : Console.Write ("--> Invalid usage - contact TEC-IT"); break;
case DataFieldUsage.Normal : Console.Write ("--> The DataField is used within the FormLayout; its value can be set"); break;
case DataFieldUsage.NotUsed : Console.Write ("--> This DataField is not used in this FormLayout"); break;
case DataFieldUsage.Parameter : Console.Write ("--> This is a system DataField (like the page number) used within the FormLayout"); break;
}
Console.WriteLine();
datafield = datafield.Next;
}