Schema Attribute Default Not Working | Community
Skip to main content
July 24, 2017

Schema Attribute Default Not Working

  • July 24, 2017
  • 1 reply
  • 3876 views

Hi there,

im trying to define a schema attribute with a default value. I updated my input form to show this new attribute.

The attribute is shown but is blank, the default value did not take into account.

This is my attribute tag setting:

--FIRST TRY----

<attribute default="50" desc="" label="Offer Validity Days" name="offerValidityDays" type="long"/>

--SECOND TRY----

<attribute default="1" label="Offer Validity Days 1" name="offerValidityDaysNew"  type="string"/>

None of them seems to work.

Any advice?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Marcel_Szimonisz
Community Advisor
Community Advisor
July 24, 2017

Hello stefanoc17252495​,

Looking at the documentation,

,you probably have to use also sqlDefault, same as default attribute, in your schema definition.

Marcel

July 24, 2017

Hi Marcel ,

thank you for the quick reply.

I need to use the "default" attribute, because i need to pre-fill that field with a dynamic value when creating an entity.

Im not able to make this simple "default" attribute working. 

July 25, 2017

Hi,

What Marcel suggested will work in the schema but If you are using the form to create this entity then you should use default in the form or use set in for to set a value while creating a form.

Regards,

Amit


Thank you all guys.

I will make a try.

BR