Open Closed

Default Value not set if property is set to Required #8822


User avatar
0
granade created
  • ABP Framework version: v0.9.23
  • UI Type: Blazor Server
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): No
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

If you Save and Generate a property with a default value, the value will be set on new entries as long as Required isn't checked. If Required is checked, the default value isn't populated when creating a new record. If you uncheck Required and Save and Generate, Default Value will again be set when creating a new record.


4 Answer(s)
  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Hi,

    I assume you're asking for ABP Suite, right?

    Can you provide us an example to reproduce the issue? It might be a bug as you say, we'll check the same scenario

  • User Avatar
    0
    granade created

    Sorry about that, yes...when using ABP Suite. Below you'll see Year and Mileage have default values. But if you check required on a property as I did on Year, the default value isn't populated. Uncheck Required and it starts populating the default value again.

  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Thanks for your detailed explaination. I've reproduced the problem and creating an internal issue to our ABP Suite team for it. We'll fix it soon.

    Also your ticker is refunded.

  • User Avatar
    0
    granade created

    Thanks.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.2.0-preview. Updated on March 13, 2025, 04:08