Question

Remove column/element requirement

How do I make a edit page column not required. I changed the parameter in the object to not be required.

Image: https://prnt.sc/1uc9tfx

But the columns is still required in my page.

This is my column. I'm looking for a parameter which sets required to false.

I tried "required": false , but it didn't work

			{
				"operation": "insert",
				"name": "LeadType",
				"values": {
					"bindTo": "LeadType",
					"layout": {
						"colSpan": 19,
						"rowSpan": 1,
						"column": 5,
						"row": 2
					},
					"enabled": false,
					"caption": {
						"bindTo": "Resources.Strings.LeadTypeCaption"
					}
				},
				"parentName": "BantProfileHeaderContainer",
				"propertyName": "items",
				"index": 2
			},

 

Like 0

Like

8 comments

Hello Julius

 

Is the require check box checked in the section wizard ?

 

LÉZORAY Nicolas, My Column was added in the JS-Client module by text only. It's not visible in the Section wizard unfortunetly

you try in JS:

this.set("isRequiredField", false);

 

On a required field in the business rules source code ive got:

....

}/**SCHEMA_DETAILS*/,

        businessRules: /**SCHEMA_BUSINESS_RULES*/{

....

            "UsrField": {

                "e7e8e676-bf50-4c2c-a8cb-41516f7c83cb": {

                    "uId": "e7e8e676-bf50-4c2c-a8cb-41516f7c83cb",

                    "enabled": true,

                    "removed": false,

                    "ruleType": 0,

                    "property": 2,

                    "logical": 0,

                    "conditions": [

                        {

                            "comparisonType": 3,

                            "leftExpression": {

                                "type": 1,

                                "attribute": "isRequiredField"

                            },

                            "rightExpression": {

                                "type": 0,

                                "value": true,

                                "dataValueType": 12

                            }

                        }

                    ]

                }

            },

...

}/**SCHEMA_BUSINESS_RULES*/,

        attributes: {

            "isRequiredField": {

                dataValueType: this.Terrasoft.DataValueType.Boolean,

                type: this.Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,

                value: false

            },

 

Hope it can help you !

LÉZORAY Nicolas,

 

Thanks for good idea! 

LÉZORAY Nicolas,

It didn't work out for me. I was hoping for something without Conditions.

Is there a property on the Columns/Element that's called isRequiredField ?

Julius,

 

The LeadType remains required because of the base business rule on the BaseLeadPage schema that can be also found in the business rules of the lead section wizard:

You need to disable it to make the LeadType non required.

 

Best regards,

Oscar

Julius,

 

As mentioned in the comments, HTML5 does have the "required" attribute, but at the moment it does not work correctly in most browsers.

 

Alternatively, you may create a JS logic function, which will check the field on client side -

if (field==null || field=="")

  {

  alert("The field needs to be filled in!");

  return false;

  }

 

etc.

 

Another way - create some fields required/not required through Section Wizard and check the code how this fields will be created in Shema (ContactPageV2) etc. - if you add fields in Contact Section. 

 

Also, you can set up business rules to make field mandatory:

 

https://academy.creatio.com/docs/user/no_code_customization/ui_and_busi…

 

However, the main check should be on the server side, because it's much reliable,  that's why we are highly recommend to create fields in Section Wizard and the check box checked - will 100% work. 

 

Hopefully it helps! 

 

Best Regards, 

 

Bogdan L.

Oscar Dylan,

 

Thanks for sharing this useful tip!

 

 

Show all comments