Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Adding a related field and populating with historical data

Posted on by Microsoft Employee

Hi,

We have a custom field on our opportunity entity (new_brand) - I was tasked with adding this field to both our quote and then the product.

new_brand is an option set currently at the entity level. I have added "brand" to the other 2 entities and used script to select the correct value when a page loads - that is all fine.

I have been asked to populate this for historical reporting. I did not create relationships when I set it up and not sure that would help here. We have new_brand on opportunity - the quote needs to set it brand to the opportunity it belongs to and the product needs to set it's brand to the quote it belongs to.

I have a few idea's on how to do this but not sure which would be the best way.

All help appreciated.

*This post is locked for comments

  • ashlega Profile Picture
    ashlega 34,475 on at
    RE: Adding a related field and populating with historical data

    Hi,

     this may not be a "supported" solution, but it's all about risks and rewards... it's CRM 2011, so it's on-prem, so you have access to the db.. just go to the database and set field values there (test that script on a backup copy first) - you'll avoid quite a few problems (having to re-open deactivated historical records.. or having to write that console app)

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Adding a related field and populating with historical data

    Thanks - I have yet to write a council app using the SDK - strange situation here - We are running CRM2011 and I have VS2015 on my laptop - the 2011 SDK will not install into this version of Visual Studio. Is there at least a good article or example code on how to do what you propose I could look at while we work our upgrade to 2013?

  • Suggested answer
    Dynamics_Alok Profile Picture
    Dynamics_Alok 1,746 on at
    RE: Adding a related field and populating with historical data

    I would go with Console Application .Write a console app and fetch all historical record for Opportunity and get new_brand .Now fetch associated Quote and update field and same for Product records.

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

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 Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans