Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Schema Attribute Default Not Working

Avatar

Avatar
Validate 1
Level 1
stefanoc1725249
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
stefanoc1725249
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
stefanoc1725249
Level 1

24-07-2017

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?

Replies

Avatar

Avatar
Validate 10
MVP
MarcelSzimonisz
MVP

Likes

102 likes

Total Posts

224 posts

Correct Reply

56 solutions
Top badges earned
Validate 10
Validate 1
Shape 1
Boost 50
Boost 5
View profile

Avatar
Validate 10
MVP
MarcelSzimonisz
MVP

Likes

102 likes

Total Posts

224 posts

Correct Reply

56 solutions
Top badges earned
Validate 10
Validate 1
Shape 1
Boost 50
Boost 5
View profile
MarcelSzimonisz
MVP

24-07-2017

Hello stefanoc17252495​,

Looking at the documentation,

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

Marcel

Avatar

Avatar
Validate 1
Level 1
stefanoc1725249
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
stefanoc1725249
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
stefanoc1725249
Level 1

24-07-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. 

Avatar

Avatar
Validate 10
MVP
MarcelSzimonisz
MVP

Likes

102 likes

Total Posts

224 posts

Correct Reply

56 solutions
Top badges earned
Validate 10
Validate 1
Shape 1
Boost 50
Boost 5
View profile

Avatar
Validate 10
MVP
MarcelSzimonisz
MVP

Likes

102 likes

Total Posts

224 posts

Correct Reply

56 solutions
Top badges earned
Validate 10
Validate 1
Shape 1
Boost 50
Boost 5
View profile
MarcelSzimonisz
MVP

24-07-2017

Hello,

Try to add <attribute sqlDefault="1" default="1"

Default is for the form so the user can see it and sqlDefault is to write default to database

Marcel

Avatar

Avatar
Validate 10
MVP
Amit_Kumar
MVP

Likes

329 likes

Total Posts

649 posts

Correct Reply

231 solutions
Top badges earned
Validate 10
Validate 1
Establish
Give Back 50
Give Back 5
View profile

Avatar
Validate 10
MVP
Amit_Kumar
MVP

Likes

329 likes

Total Posts

649 posts

Correct Reply

231 solutions
Top badges earned
Validate 10
Validate 1
Establish
Give Back 50
Give Back 5
View profile
Amit_Kumar
MVP

24-07-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

Avatar

Avatar
Validate 1
Level 1
stefanoc1725249
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
stefanoc1725249
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
stefanoc1725249
Level 1

25-07-2017

Thank you all guys.

I will make a try.

BR