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, ...
Answered

build/sync models

(0) ShareShare
ReportReport
Posted on by 120

hello All,

please i need a script powershell for the following tasks:

Once the models are imported, perform a model refresh as well as a full sync using script powershell.

I found these examples but im not sure and i didn't undesrstand the content.

Build script:
K:\AOSService\PackagesLocalDirectory\bin\xppc.exe -metadata="K:\AosService\PackagesLocalDirectory" -modelmodule={model name}
-output="K:\AosService\PackagesLocalDirectory\{model}\bin" -referenceFolder="K:\AosService\PackagesLocalDirectory" -log="C:\temp\buildmodelresult.txt"
-xmllog="K:\AosService\PackagesLocalDirectory\{model}\BuildProjectResult.xml" -nowarn

sync script:
K:\AOSService\PackagesLocalDirectory\bin\syncmode="fullall" -metadatabinaries="K:\AosService\PackagesLocalDirectory"
-connect="Data Source=localhost;Initial Catalog=AxDB;Integrated Security=True;Enlist=True;Application Name=AXVSSDK" -verbosity="Minimal"

Do you have any idea about this?

thank you in advance.

I have the same question (0)
  • huijij Profile Picture
    19,811 on at

    Hi Sushma,

    Would you specify what the issue are you facing now?Please check the old thread to see if you can get some tips:

    community.dynamics.com/.../how-to-build-the-d365fo-model-using-powershell-script

  • Microsoft Dynamics 365 Community Profile Picture
    120 on at

    thanks for your reply

    i want to perform a model refresh as well as a full sync using script powershell.

    could you please help me?

    thank you

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    What do you mean with the "model refresh"? What problem are you trying to solve? Since you're building from the command line, I'm sure that each model that you build are already "up to date". The refresh only has impact inside Visual Studio, as far as I know.

  • Microsoft Dynamics 365 Community Profile Picture
    120 on at

    hello,

    it's about thse steps:

    Dynamics 365 / Model Management menu, do a Refresh models

    Dynamics 365 / Build Model menu, do a total build associated with a full sync

    is there a way to do this with a powershell script?

    thank you

  • YY Lim Profile Picture
    960 on at

    Like Nikolaos mentioned above, you do not need to refresh models for script build, the refresh model is only to show you on Visual Studio if you get the latest code from DevOps.

  • Microsoft Dynamics 365 Community Profile Picture
    120 on at

    thank you for your reply

    I want  to  understand if it's possible or not because im new to this i don't have experience on dynamic 365

    So the refresh model we do it manually through visual studio, we can't do it with powershell??

  • Verified answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    The question is still: what are you trying to achieve by automatic refresh of the models? 

    I assume you're trying to create some automatic script that developers can use to get latest and build the latest code every night. Correct? This doesn't require you to "refresh models" in Visual Studio.

    "Refresh models" only makes sense if you're fetching new code from the source control while Visual Studio is open. But if your script runs at the night time, and the developer opens Visual Studio in the morning, there should be no need to refresh anything. They will have the latest model version numbers and other model metadata automatically.

  • Suggested answer
    Sheikh Sohail Profile Picture
    6,125 on at

    Have look at the below URL for understanding.

    d365technext.blogspot.com/.../package-deployment-using-run-book.html

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 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans