web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

How to update data before db-sync on code deployment

(0) ShareShare
ReportReport
Posted on by 18

Hi

Let's say that I want to add a new unique index to a table in D365FO, but in order for this to work I need to manipulate the records in the table before the db-sync is executed, how to do that with a deployable package?

Thanks

I have the same question (0)
  • Suggested answer
    Sukrut Parab Profile Picture
    71,710 Moderator on at

    When you say , you want to manipulate records , do you want to correct data ? If yes , first correct data  in one deployment using  your first package  and then release a package which has index changes.

  • CU03040925-0 Profile Picture
    18 on at

    I was more thinking of something like this:

    docs.microsoft.com/.../pre-post-scripts

    at the 'Servicing' sections it indicated that it is possible to execute some scripts, but I have not been able to find any information about it

  • Suggested answer
    Mea_ Profile Picture
    60,284 on at

    As been said you have to deploy first package with a script to correct data, run it and then deploy second package with new index, there is no other way to do so. 

  • Suggested answer
    Navneeth Nagrajan Profile Picture
    2,438 Super User 2025 Season 2 on at

    Hello Rabol,

    Under the servicing section of the article that you shared, it states that the existing artifacts are validated first.

    As Sukrut and Ievgen mentioned, your data exists initially and you will need a runnable class to manipulate the data. Add the index to the table once the data is manipulated and then run the db-sync operation.

    On the other side, you can setup a release pipeline through Azure DevOps to trigger your Pre-deployment and Post-Deployment scripts. This release definition will automate your deployment operations that you run regularly.

    Thanks,

    Navneeth Nagrajan | Dynamics 365 Technical Consultant

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 592 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 478 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 305 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans