Column validation in an editable detail

Hello Community, 

 

I have a requirement to validate a Column in the editable detail.

How can we achieve this? I tried using validators with the column name of Datagrid. But it didn't worked.

 Any suggestions is really helpful. 

 

Thanks

Gargeyi.G

File attachments
Like 0

Like

3 comments

Hello,

In order to add validation to an editable detail you need to override the method save() in the detail page, for example:

define("UsrSchema1051cea3Page", [], function() {
	return {
		entitySchemaName: "UsrTestDetObj",
		attributes: {},
		modules: /**SCHEMA_MODULES*/{}/**SCHEMA_MODULES*/,
		details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
		businessRules: /**SCHEMA_BUSINESS_RULES*/{}/**SCHEMA_BUSINESS_RULES*/,
		methods: {
			save: function() {
                    if (this.get("UsrName") == "1") {
                        this.callParent(arguments);
                    } else {
                        this.showInformationDialog("UsrName should be 1 ");
                    }
                }
		},
		dataModels: /**SCHEMA_DATA_MODELS*/{}/**SCHEMA_DATA_MODELS*/,
		diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/
	};
});

 

Hello, 

 

Thankyou for your response, 

But I wanted to validate columns in the detail,

I don't open the detail page and so I don't want to validate in the detail page but in the inline record.

please find attached screenshot

Hi,

This example is working on a detail itself.

With it, you cannot save the record unless the condition is met.

Considering the fact that detail fields are virtually generated, this is the best option to add validation.

Show all comments