cancel
Showing results for 
Search instead for 
Did you mean: 

How to set a custom property as mandatory attribute while saving model from backoffice

0 Kudos
1,005

Hi Experts,

We have a requirement where we created a new enum type "channelIndicator" which is a mandatory one on Product Item type. We have also customized product creation wizard to display this property while creating a new product. This property is working fine when we are creating new products. However for existing products, when we try to modify any property from Administration section, the system is not stopping us from saving the product data. As per our requirement, it should stop us from saving existing products if we don't select any value for "channelIndicator" property in Administration section.

How can we accomplish this. Any help on this would be truly appreciated.

Awaiting your reply.

Thanks DurgaRao

former_member620692
Active Contributor
0 Kudos

You can create a validation constraint. Please refer https://help.hybris.com/1808/hcd/cb8edb3b88c94968b5c8c38cdc039829.html to achieve this.

former_member620692
Active Contributor
0 Kudos

Hi - was it helpful? If yes, you can Accept and/or upvote it.

0 Kudos

Hi Arvind,

Thanks for your reply. I have tried this approach in my local environment and its working fine when I tried to update the property from Administration section. The system was able to restrict the user from saving the Product information if he didn't choose any value for my custom property 'channelIndicator'. However when I tried to create a new Product from create product wizard, there the "channelIndicator" field is showing in Red color saying its mandatory even though we already customized it to be mandatory from backoffice-config.xml. We don't want the constraint to be at create-product wizard level. What we need is the constraint needs to be worked only in Administration section.

Finally what we did is not completely fulfilling the requirement.

Please check and let me know if you find any other way. Once Again thanks for your help...!

View Entire Topic
former_member702005
Participant
0 Kudos

Please check answers in that thread https://answers.sap.com/questions/12770473/required-field-wizard.html?childToView=12832395 and see if any of them work for you. Note the two aspects discussed: making a field mandatory through validation engine and displaying an asterix "*" next to the field name.

0 Kudos

Hi Lukas,

Thanks for your reply. But Unfortunately, the mentioned thread won't satisfy my requirement.