Posts

Showing posts from July, 2020

Sitecore forms cool feature

Image
Sitecore continue to add great new feature to forms some that what we expect earlier, I just explore the Sitecore 9.3 forms and found lot of cool feature so i listed down some point. a. Create a Multi page form:      This is cool feature to create multiple page in one form and you can manage by forms by       conditions. b. Publishing and Delete data within form module directly     In forms we can save and publish it directly and also we can delete the forms data just select the form and do the operation directly. d. Email confirmation field     In forms you just drag&drop email confirmation field and see the magic! e. Boat detection:       Robo! we can use the bot detection functionality to verify the visitor is human so we don't need       captcha here, Awesome work by Sitecore team! f. Redirect to external URL:   If the requirement comes to redirect external URL then you can use by default feature to do some        setting, just click

Add Custom Validation in Sitecore 9.3 Forms

Image
A quick walk through to add custom validation in Siteccore forms! Well In Sitecore forms we can add validation as per our business requirement So quickly gone through that logic part! So firstly we need to create CustomValidation  class in our solution and inherit by  ValidationElement and make sure you added reference with Sitecore.ExperienceForms.Mvc.dll  So for example we are restrict to user to only small letter in our text box so you need to give pattern  as per need, In bold line you can see the pattern as per need can be change! below code is to override validation forms.   public class CustomValidation : ValidationElement<string>     {         private const string NamePattern = "^[a-z]*$";         public CustomValidation(ValidationDataModel validationItem) : base(validationItem)         {         }         public override IEnumerable<ModelClientValidationRule> ClientValidationRules         {             get             {              

Add Custom Save Button in Sitecore 9.3 Forms

Image
In Sitecore Forms we can easily add custom save button to manipulate forms data, Well i had a requirement to capture some data from forms and insert it under custom database.  So its allow to override this one! let's start to create logic for capture data! Just create a MVC solution and add refrence Sitecore.Kernel, Sitecore.Mvc and Sitecore.ExperienceForms.dll after that just create a class and inherit  by SubmitActionBase.  you need to add some more references in your class. using Sitecore.Diagnostics; using Sitecore.ExperienceForms.Models; using Sitecore.ExperienceForms.Processing.Actions; using Sitecore.ExperienceForms.Processing; Below code you need to add under your class to execute your custom button.  public forms(ISubmitActionData submitActionData) : base(submitActionData)         {         }         public override void ExecuteAction(FormSubmitContext formSubmitContext, string parameters)         {             Assert.ArgumentNot