Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Suggested answer

How to add column in one entity and that column also auto add in multiple table

(0) ShareShare
ReportReport
Posted on by 15

when i create a column in an entity and that column should be automatically add in multiple another entities.

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: How to add column in one entity and that column also auto add in multiple table

    Hi,

    Instead of replicating the data to multiple entities ,. What you can do is to create column at parent Entity and use quick view form to show this field  data in child entities.

    www.google.com/url

  • Suggested answer
    - Matt Bayes - Profile Picture
    - Matt Bayes - 890 on at
    RE: How to add column in one entity and that column also auto add in multiple table

    Hi Ravan,

    The only way to automatically create columns would be to write custom code in order to utilize the CreateAttributeRequest in the SDK (docs.microsoft.com/.../microsoft.xrm.sdk.messages.createattributerequest

    Unfortunately, there's no trigger in a plugin or workflow for "When a new field is added to a table", and so you may have to get creative in how you want to build this.

    If I were to try to accomplish this, I would:

    1. Create a table called "New Attribute Request" that would have columns in line with the data you need to create a new attribute using the SDK message above (ie. Table Name, Field Name, Field Type, etc.)

    2. Create a plugin that runs on the Create message of the "New Attribute Request" table, retrieves the field information, and calls the "CreateAttributeRequest" message from the SDK, using the fields as the input parameters for the message. In here you would also call the "CreateAttributeRequest" for any other table you want that field to automatically be created on.

    3. If you wanted it to be a little more dynamic, I would have a field on the "New Attribute Request" that can be used to identify what table(s) you would like the new field to automatically be created on. For example, a multi-select option set that could have Contact and Account selected, which would then tell the process to automatically create the field on those 2 tables.

    Essentially what this process would be doing is allowing the user to create a record in the New Attribute Request table that would automatically create the column on the identified table, as well as create the same column on any other identified tables on that record.

    I hope this sort of makes sense and gives you a starting point.

    Thanks!

    Matt Bayes

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,359 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans