Querying forms
You can retrieve single or all forms:
Find a form
To find a specific form, you use the FormsManager class and LINQ queries. The following code finds a form with the specified formIdthrough the Native API.
private FormDescription FindForm( Guid formId )
{
var formManager = FormsManager.GetManager();
return formManager.GetForms().Where( f => f.Id == formId ).SingleOrDefault();
}
First, you initialize the FormsManager. Then, you must call GetForms to retrieve all forms and, finally, you filter the lists based on the Idproperty.
NOTE: You can filter by any of the form's properties.
Retrieving all forms
To retrieve all created forms, you use the FormsManager class:
private List<FormDescription> GetAllForms()
{
var formManager = FormsManager.GetManager();
return formManager.GetForms().ToList<FormDescription>();
}
First, you initialize the FormsManager. Then, you must call GetForms to retrieve all forms and, finally, you convert to list.