Kentico 8.2 Free Edition License Question

Jim Piller asked on October 7, 2015 17:56

Hello,

I am using the Kentico Free Edition 8.2 and I have setup a BizForm that I am trying to implement. I was under the impression that you could have one form on the free edition of Kentico, but when I submit the form, I get the following error:

The license limit for feature BizForms was exceeded. Please check the event log to get more details.

I have verified that there is only one form, I started w/ the blank site template, so I don't think there is a hidden form anywhere in the system as the CMS_Form table only has one record for the form I created.

Is the form not accessible through the API? My submit code is below...any help would be appreciated.

Thanks,

Jim P.

protected void btnSubmit_Click(object sender, EventArgs e)
{
    BizFormInfo formObject = BizFormInfoProvider.GetBizFormInfo("HomePageContactForm", SiteContext.CurrentSiteID);

    // Gets the class name of the 'ContactUs' form
    DataClassInfo formClass = DataClassInfoProvider.GetDataClassInfo(formObject.FormClassID);
    string classname = formClass.ClassName;

    if (formObject != null)
    {
        ObjectQuery<BizFormItem> data = BizFormItemProvider.GetItems(classname)
            .WhereEquals("Email", Email.Text)
            .Columns("Email");

        if (DataHelper.DataSourceIsEmpty(data))
        {
            formObject.SetValue("Email", Email.Text);
            formObject.SetValue("FormInserted", DateTime.Now);
            formObject.SetValue("FormUpdated", DateTime.Now);
            formObject.Insert();

            Response.Redirect("/ThankYou");
        }
        else
        {
            Response.Redirect("/EmailExists", true);
        }
    }
}

Correct Answer

Brenden Kehren answered on October 7, 2015 23:28

Ok just checking. As I looked at your syntax, it looks to be incorrect. Your formObject object is a BizFormInfo object (new biz form) and not an actual form item. See code below:

protected void btnSubmit_Click(object sender, EventArgs e)
{
    BizFormInfo formObject = BizFormInfoProvider.GetBizFormInfo("HomePageContactForm", SiteContext.CurrentSiteID);

    // Gets the class name of the 'ContactUs' form
    DataClassInfo formClass = DataClassInfoProvider.GetDataClassInfo(formObject.FormClassID);

    if (formClass != null)
    {
        ObjectQuery<BizFormItem> data = BizFormItemProvider.GetItems(formClass.ClassName)
        .WhereEquals("Email", Email.Text)
        .Columns("Email");

        if (DataHelper.DataSourceIsEmpty(data))
        {
            BizFormItem formRecord = BizFormItem.New(formClass.ClassName);
            formRecord.SetValue("Email", Email.Text);
            formRecord.SetValue("FormInserted", DateTime.Now);
            formRecord.SetValue("FormUpdated", DateTime.Now);
            formRecord.Insert();

            Response.Redirect("/ThankYou");
        }
        else
        {
            Response.Redirect("/EmailExists", true);
        }
    }
}

You need to create a new instance of the BizFormItem BizFormItem.New(form class name)

2 votesVote for this answer Unmark Correct answer

Recent Answers


Virgil Carroll answered on October 7, 2015 18:16

I'm not sure you can access that particular API with the free version. Instead I would try and use the default form process and see if that works...if so then you will know the limitation.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on October 7, 2015 19:01

How many forms to you have already created? If you have more than one for that site then you won't be able to use the features (api or not).

0 votesVote for this answer Mark as a Correct answer

Jim Piller answered on October 7, 2015 19:08

As I said in the original question, I only have the one form created. Doesn't seem right that you would only get half the feature does it?

0 votesVote for this answer Mark as a Correct answer

Jim Piller answered on October 7, 2015 19:27

As an aside, I was able to use the API to save a record in a custom table with no problem which suggests to me that I should be able to use the API for the forms. It would be nice to have some clarification on whether or not it is possible and I might just be missing something.

0 votesVote for this answer Mark as a Correct answer

Roman Hutnyk answered on October 7, 2015 23:32

You're trying to insert another BizForm, but you need to insert biz form item instead.

0 votesVote for this answer Mark as a Correct answer

Jim Piller answered on October 8, 2015 19:02

Thanks everyone for the help w/ the coding problem. I thought it was odd that I wouldn't be able to access the BizForm objects through the API even in the free version. Really appreciate the help!

Cheers!

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.