Error in metadata.xml when following custom datatype example

I have some transient fields that I want to display in read-only textfields and I need them formatted a certain way, so it seems I have to set up a custom datatype to do that. No big deal!

However, following the examples, I have an error displayed in metadata.xml:

xsd-error-datatype

Note - everything works fine and the custom datatype works as expected except I can’t select it from the dropdown in the screen designer (because it’s not listed). If I type it in manually in the source code view it all works fine.

Hi @jon.craig,

I have used custom datatypes, but in my case I used datatype tag as the first child item (above metadata-model):

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<metadata xmlns="http://schemas.haulmont.com/cuba/metadata.xsd">
    <datatypes>
        <datatype id="percent" class="com.example.datatype.PercentDatatype"/>
    </datatypes>
    <metadata-model root-package="com.example" namespace="app"/>
</metadata>

Try changing the order.

Regards,
Peterson.

1 Like

Yeah, that makes the error line go away. Weird.