If it's true that the GetFormsInfo() method does not include any forms referenced in the "On this page" local folder, this is probably a bug and makes it slightly more challenging, as you’re going to need to find a way to retrieve the form identity from the content reference, probably by querying the DDS directly. I would go with this approach:
Although I must say this feels like a slightly messy workaround for the GetFormsInfo() not retrieving instances of the forms situated in the “For this page” folders. It may be worth checking if this is a specific bug to the version of Episerver CMS that you’re developing with, and flag it to the support team to get it fixed.
Hi James,
Thank you for your response.
With regards to 'when attempting to get the forms submission data it expects a FormIdentity which subsequently expects a language which i am not sure how to get dynamically?'
This was as simple as passing string.Empty so my code is as follows:
//get form identity - passing an empty lang returns all forms versions _formIdentity = new FormIdentity(form.FormGuid, string.Empty); //get form submissions var submissionsList = _formDataRepository.GetSubmissionData(_formIdentity, startDate, endDate);
However, the above still doesnt return forms 'for this page'
Thanks
Paul
Hi,
Im creating a schedule job to achieve the following
So far i am doing the following..
During local testing I found that _formRepository.GetFormsInfo only returns forms that have not been created 'for this page'. How can i also include forms created for this page? Also, _formRepository.GetFormsInfo returns IEnumerable so when looping through the FormInfo object only exposes the following
However, when attempting to get the forms submission data it expects a FormIdentity which subsequently expects a language which i am not sure how to get dynamically? At the minute i hard coded it like so
As this is in a schedule task and not on a page I have no content reference where i can get at the language so how can i make that dynamic?
Maybe the approach of getting all forms using the following and then looping through usages is a better approach? (https://world.episerver.com/forum/developer-forum/Developer-to-developer/Thread-Container/2016/1/get-all-blocks-by-block-type/)
Can anyone point me in the right direction please?
Thanks