0

I have a mandatory embedded field which have the optional fields in it but i'm able to save the component without any values in it. The requirement is that inside an embedded field, either of the fields should be given. If one field value is given, then other can be skipped but at least one field value is mandatory. For example, In the screenshot below, an image can be specified either by an image URL or by a multimedia image uploaded into CMS. There is no point in forcing the editor to give both but at least one should be given from both. Just by making the embedded field mandatory is not solving the issue. enter image description here

Note: I can achieve this by adding some logic through event system but i have such embedded field in almost every schema in my system and handling it through even system will highly affects the performance of CMS. Any suggestions or work arounds except event system would be of great help and much appreciated. Thanks!

4
  • 1
    This kind of logic cannot be applied in a schema restriction, unfortunately. I think Event System is your only solution here... but maybe I'm wrong.
    – Nuno Linhares
    Commented Dec 7, 2022 at 14:08
  • We finally are going with Event System only thinking that supports both Classic and New UI but there is this weird thing my events are firing and able to perform validations only in New UI only but not in Classic UI. The code and built library remains same, services are running as expected but not sure why it is not working only in classic UI. Any quick fix or troubleshooting tips would be helpful. Thanks!
    – Hari
    Commented Dec 20, 2022 at 10:34
  • Given how Event System works I cannot understand why it wouldn’t work for Classic. Restart the box?
    – Nuno Linhares
    Commented Dec 20, 2022 at 10:44
  • Yeah.. Our servers restart everyday at scheduled times.
    – Hari
    Commented Dec 21, 2022 at 5:55

1 Answer 1

1

If not the Event System then you could use another extension point such as the GUI extension, if you're using the classic interface.

The 'ReadOnly' extension could be a fair example where you catch specific [named/prefixed] fields (only in the description, not the XML name) and then script in your logic against the {collection of} fields you're interested in.

If you're wanting this in the newer UI then you will need to wait until version 10 in order to use a supported (GUI) extension point.

With regards to the Event System approach "highly affecting the performance of the CMS"... I'm wondering if you can ensure the code is optimized - if your code was just checking

a) that a component is being edited b) that a specific (one of a collection of) schema is being used

before doing any real hard processing?

1
  • We finally are going with Event System only thinking that supports both Classic and New UI but there is this weird thing my events are firing and able to perform validations only in New UI only but not in Classic UI. The code and built library remains same, services are running as expected but not sure why it is not working only in classic UI. Any quick fix or troubleshooting tips would be helpful. Thanks!
    – Hari
    Commented Dec 20, 2022 at 10:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.