Tag Archives: sitecore 9

Item:Saved Event Error Message Installing Sitecore 9 Forms

Over the course of the past 6 months I have been working a lot with Sitecore 9 forms and have gained a lot of knowledge. Here is one error you may run into when installing Sitecore 9 forms from one instance to another that may stump you. The error comes when you are installing a package of forms and forget to include the dependencies needed for the forms. Here are what I refer to as the typical dependencies:

Data Sources Used in Dynamic List Items

Let’s say you have a Checkbox List used in your form and are pointed to a fictitious list similar to this as your data source below:

Example Data Source

Example Data Source

If you package up the Forms folder, and forget to include the data source items that your lists are pointed to in your forms you will get the infamous Item:Saved event error. Make sure to include them along with your forms package and/or make sure they are installed on the destination Sitecore instance BEFORE installing your forms package.

Custom Form Functionality Items

Below is a list of the most common places in Sitecore that you will be creating custom form items to achieve the desired custom functionality from Sitecore 9 forms:

Custom Form Fields:
  • /sitecore/templates/System/Forms/Fields
  • /sitecore/system/Settings/Forms/Field Types/Basic
  • /sitecore/system/Settings/Forms/Field Types/Lists
  • /sitecore/client/Applications/FormsBuilder/Components/Layouts/PropertyGridForm/PageSettings/Settings
Custom Form Validations:
  • /sitecore/system/Settings/Forms/Validations
Custom Submit Actions:
  • /sitecore/client/Applications/FormsBuilder/Components/Layouts/Actions
  • /sitecore/system/Settings/Forms/Submit Actions

If you created custom form fields, validations, or submit actions, and these items are not already installed on your destination instance, then you will receive this error. Again, make sure to include them along with your forms package and/or make sure they are installed on the destination Sitecore instance BEFORE installing your forms package.

To summarize, Sitecore 9 forms has dependencies you must be aware of when your team starts building out the forms. Make sure that these are included in your source control and deploy with confidence. Happy coding!

No Forms To Display

“There are no forms to display” in Sitecore 9 Forms designer

In working with Sitecore 9 forms, you might occasionally get the “There are no forms to display” when you go to the Forms designer area as seen below:

No Forms To Display

No Forms To Display

This is pretty typical actually as the Forms are indexed in the “sitecore_master_index”, and I have seen this happen after doing custom form fields, validations, and submit actions. But  simply re-index and voila, you will see your forms. Our fellow MVP brethren, Jason Wilkerson, put up a post about this, which you can read in much more detail regarding re-indexing:

Sitecore 9 Forms: form doesn’t show up after creation

Now, with that being said, I have found that this is NOT the only time this can occur. At some point, my forms disappeared from the Form Designer completely, and no matter how many times I re-indexed they never came back to existence. After a couple weeks of not seeing my forms it was a MUST that I had to have the Forms Designer back not only me and my local development, but for the client as well. This bug had propagated it’s way from LOCAL to DEV & QA at this point. Before we are to go-live it MUST be fixed. So I really started getting after finding a solution!

My first stop was the always trusted and solid Sitecore community. I went to the Sitecore Stack Exchange at https://sitecore.stackexchange.com for help. I posted up this question and the community had nothing for me, but I quickly learned that I was NOT alone with this bug:

No forms are displaying in Sitecore 9 Forms area

Being that Sitecore 9 Forms are a tad bit new to the community we are all still learning these forms one day at a time so there wasn’t much to go off of for any of us in this situation, and most were busy, and didn’t have time to look into. So my next stop was Sitecore Support. I put in a ticket with Sitecore Support. About 24 hours later they came back asking me for my .configs and me to run a test through Fiddler to see what was going on. Once I got them what they needed, they got me what I needed, which was the answer. The Sitecore Support team saw from Fiddler that the requests for available forms returned an error, which is below:

4268 07:53:01 ERROR [Item Web API] Value cannot be null.
Parameter name: item
Exception: System.ArgumentNullException
Message: Value cannot be null.
Parameter name: item
Source: Sitecore.Kernel
   at Sitecore.Diagnostics.Assert.ArgumentNotNull(Object argument, String argumentName)
   at Sitecore.ContentSearch.SitecoreIndexableItem..ctor(Item item)
   at Sitecore.ItemWebApi.Pipelines.Request.Search.RunSearchPipeline(RequestArgs args, String searchText, String languageName, Boolean showHiddenItems)
   at Sitecore.ItemWebApi.Pipelines.Request.Search.Process(RequestArgs args)
   at (Object , Object[] )
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain)
   at Sitecore.ItemWebApi.Pipelines.HttpRequest.LaunchRequest.Process(HttpRequestArgs arguments)

They had me navigate to the {60F35FD9-88CB-4DF5-8E78-1E9BF5FE181C} item in the core database. That item is seen below:

Sitecore 9 Search Config Item

Sitecore 9 Search Config Item

As you can see from above the Root field is pointed at {B701850A-CB8A-4943-B2BC-DDDB1238C103}. When I put this ID in my search bar and searched the Master database content tree, there was NO results. I decided to get with one of my co-workers who had a working instance of Sitecore 9 Forms, and had them search for this item in the Master database content tree. BOOM! Once they ran the search, the Forms folder, which contains all the forms, came back as a result.

Wrong ID For Forms Folder

Wrong ID For Forms Folder

When I saw that I had the wrong Forms folder ID, I knew that somewhere along the check-in source control travels someone must have deleted the original Forms folder, and then created a new Forms folder with a different ID. Because of this one simple change by a developer the Forms Designer was now rendered useless and ineffective. This is something to be aware of!

The solution to this issue is this:

  1. Do NOT delete the Forms folder and create a new one if you don’t need to!
  2. If you do delete the Forms folder, get it from another instance of Sitecore 9.
  3. If for some reason you want to run with a Forms folder with a different ID then you must change to this ID for your new Forms folder in the Root field of these items below in the Core database:
    SearchConfig: {60F35FD9-88CB-4DF5-8E78-1E9BF5FE181C}
    AllFormsSearchConfig: {60F35FD9-88CB-4DF5-8E78-1E9BF5FE181C}

My recommendation is to NOT opt for #3 as this will get away from you, and your client down the road unless you document it, keep for future reference, and refer to for future upgrades. Ain’t nobody got time for that! Just opt to get on Slack and ask someone for the OOTB Forms folder item in a package, move all your forms into the correct OOTB Forms folder and you are all set. Happy coding!

 

Sitecore 9 Experience Editor

Glass.Mapper Experience Editor Issue with Sitecore 9

My team and I were doing some development over the past couple of weeks with Sitecore 9 and Ignition, which uses Glass.Mapper. We updated Ignition in the project to use Glass.Mapper Version 4.4.0.199. All was working fine for rendering out the fields to the page, but when it came to rendering out the text fields to the Experience Editor and having them be Experience Editor friendly, “Houston, we had a problem”!

We were using the HTML helper below:

@Html.Glass().Editable(Model, x => x.Title)

When we got to the Experience Editor, the page looked liked this due to all the text fields we had using the HTML helper:

Experience Editor Issue

Experience Editor Issue

My assumption, was that Sitecore 9 was not playing well with the older Glass.Mapper versions, but I could not be for certain. Luckily, thanks to this awesome Sitecore community, I got on the “Glass” channel of Slack and asked what might be the issue, and Mike Edwards got back to me right away stating, that I should use the “4.4.1.328-beta (Pre-Release Version)” as that is the first one to have all the changes for Sitecore 9. I was right on track to fix the issue, but after looking in NuGet I could not find it! Turns out I needed to check the “Include prerelease” checkbox pointed out below (image thanks to Mike Edwards). Good lookin’ out Mike!

NuGet Pre-Release Version

NuGet Pre-Release Version

Once I updated my solution to the 4.4.1.328-beta (Pre-Release Version), the strings were then Editable in the Experience Editor making me, the development team, and the QA people happy campers now that they can test functionality of our components. Happy coding!