Today's dilemma: running the Data Dictionary SYNC task using the start-up command in AX.
The code is coming from a greater script:
$params = "`"" + $AXCONFIGPATH_DEFINE + "`" -lazyclassloading -lazytableloading -minimize -model=" + ($MODELTOBUILD_DEFINE)
Write-Host "Synchronizing database; started: " $date
$date = Get-Date
$axProcess = Start-Process -PassThru ($axClientPath_DEFINE + "`\Ax32.exe") -WindowStyle minimized -ArgumentList ($params + " -StartupCmd=Synchronize")
if ($axProcess.WaitForExit($AXSYNCTIMEOUT_DEFINE) -eq $false)
Throw ("Error: Synchronize did not complete ok")
So the idea is that you should have a sync'ed data dictionary at the end of the process.
This is not the case if you ran into sync Errors ...
You (can) / should also try to add
$params = "`"" + $AXCONFIGPATH_DEFINE + "`" -lazyclassloading -lazytableloading -minimize -model=" + ($MODELTOBUILD_DEFINE) + " -internal=NoModalBoxes"
The way it worked for me was, that even if it didn't prompted for the sync window, it still gave a blocking infolog window at the end of the process.
And as a result of that, yes, the process will time-out with no telling what happen ... What to do in this case? Not sure yet, still researching ...