Ticket Q256530
Visible to All Users
Duplicate

Add dynamic field to a DC entity

created 15 years ago

I am trying to migrate some of my 9.3 code to 10.1 and could ask a series of questions.
This one is about adding a dynamic member to an entity I added to generate.
I need to get an XPClassInfo from that entity and apply the same code as before from there.
Is it the right path to migration or is there a better way?
Thanks
Mohsen

Show previous comments (3)
?
Unknown 15 years ago

    We need dynamic fields to customize the application business model to the needs of our customers and as you could guess almost every customer has different needs in this area. Nowadays, every software has to provide some kind of extension to its schema in order to fit exactly user's requirements.
    To get back to the sample I provided, here is a modification I made to module.cs:
    public override void CustomizeTypesInfo(ITypesInfo typesInfo)
            {
                base.CustomizeTypesInfo(typesInfo);
                XPDictionary xpdict = XafTypesInfo.XpoTypeInfoSource.XPDictionary;
                if(xpdict.GetClassInfo(typeof(IProject)).FindMember("RollupAmount") == null)
                {
                    xpdict.GetClassInfo(typeof(IProject)).CreateMember("RollupAmount", typeof(decimal), true,false);
                }
                XafTypesInfo.Instance.RefreshInfo(typeof(IProject));
            }
    I can see that it is creating the new member but it is not showing in grid later.
    I will try to find a solution anyway because it is such a fundamental functionality in our application that will prevent to upgrade tom 10.1 until it is solved.
    Mohsen

    DevExpress Support Team 15 years ago

      Hi Mohsen,
      Thank you for the clarification. I agree that this feature could be useful. I have registered a suggestion about it. Our developers will research this task, and possibly implement it in a future update. You can track its state via DC - Provide support for dynamic members in domain components.
      Thanks,
      Michael.

      ?
      Unknown 15 years ago

        Thanks

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.