Base solution for your next web application
Open Closed

Custom Fields #4539


User avatar
0
moetarhini created

Hello Support,

How can we enable Users to Define User Defined Fields at Run Time and make those Fields available in the UI Forms?

Also, can we expose those Fields to the Listing Pages where you show for example the List of All Users? Can they see the UDF Fields in the List as well and how?

Regards,


3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @moetarhini,

    ASP.NET Zero doesn't support this. ABP Framework defines IExtendableObject interface <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp/Domain/Entities/IExtendableObject.cs">https://github.com/aspnetboilerplate/as ... eObject.cs</a>. You can give it a try but it is not possible for us to write down all the steps for your scenario, it is out of the support scope.

    Thanks.

  • User Avatar
    0
    moetarhini created

    Thank you Support for your reply. We are using ASPNET Zero.

    Can you give us your advice on the best approach to achieve this in the Framework? We are not asking about the exact steps or Code, Just some guidelines from your core knowledge in the Framework.

    We appreciate your support.

    Regards,

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    If you want to use IExtendableObject (<a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp/Domain/Entities/IExtendableObject.cs">https://github.com/aspnetboilerplate/as ... eObject.cs</a>), then you have to implement it in your entity you want to use it. But, this will store custom data in a single column with json format. You can also use ExtendableObjectExtensions (<a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp/Domain/Entities/ExtendableObjectExtensions.cs">https://github.com/aspnetboilerplate/as ... ensions.cs</a>) to manipulate this data when you get it from database.

    The main problem using this data is, you cannot create SQL server indexes using a specific field in your custom data. It is also hard to query using a custom data column from SQL Server.