Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Hi,
You probably should use the IFormRepository and IFormDataRepository interfaces to retrieve forms.
Then you should be able to do:
var forms = _formRepository.Service.GetFormsInfo(null);
foreach (var form in forms){
...
}
Paul
I'm trying to get all the forms from the content repository and am trying this:
var formContainerType = _contentTypeRepository.Load(typeof(FormContainerBlock)); var formContainerReferences = _contentRepository.GetDescendents(ContentReference.RootPage); var allForms = _contentRepository.GetItems(formContainerReferences, LanguageSelector.AutoDetect(true)).Where(content => content.ContentTypeID == formContainerType.ID);
But I get this error on `GetItems`:
EPiServer.Core.InvalidPropertyValueException: 'Property string too long, max {1} chars'
Am I pulling this right? Seems odd to be getting this error on items that are already created.