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

Updating a Custom X++ script

(0) ShareShare
ReportReport
Posted on by 545

So, I'm giving the Custom X++ script feature a go (https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/deployment/run-custom-scripts)

Long story short - the customer wants to rename a warehouse (InventLocation) but they are getting errors which are related to the fact that it is used in some InventDim records - which can't be simply renamed due to the SHA hash codes - so I need to fix them manually.

I create a deployable package for a new model with 1 runnable class as per the instructions, and uploaded it to the custom scripts screen.

I then realized that I wanted to do an additional change, so I did the change and tried to upload a second time.  Now I get the following message when I try to upload:

A deployable package with the assembly signature 'Dynamics.AX.InventLocationTransferScript, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' already exists. The system will reuse the implementation from the existing package. Do you want to continue?

If I press cancel the process is abandoned, if I press Ok and continue, the process will keep on running my old script.

  • My model version is 1.0.0.0 but even if I change it to up to 2.1.1.1 - so all versions, the assembly is still 0.0.0.0 and there is no way to specify it in the creation of the package or in the descriptor.  The dll, if I unzip the deployable package is 2.1.1.1.
  • I have checked the error and its label @AppTroubleshooting:CustomScriptDeployPackageAlreadyExists but it has no references - thus meaning its probably in a dll.
  • I have also read at this link My take on the X++ custom scripts feature - ariste.info that the original assembly has been uploaded to "DIXF temp path set in the DMF parameters".

How can I get a new package in place other than creating a new model?  Is it possible to somehow delete the file from the temporary folder or to update the assembly version?

 

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    300,911 Super User 2025 Season 2 on at

    Hi Norbert,

    In the documentation, Microsoft mentioned that you should use a unique class name in each of the custom scripts. I wouldn't try to delete anything as renaming the object would be the quickest solution.

  • nspiteri Profile Picture
    545 on at

    Thanks Andre,

    Unfortunately I do not think this fixes the issue.  The way the functionality appears to work is that you first create a deployable package with 1 class.  This deployable package is then uploaded to a storage on the drive in order to run, however it only is uploaded if there isn't already a deployable package with the same version.

    As we are unable to specify the version on the creation of the deployable package, the system will assume that we are uploading the same file and thus not upload it at all.  

    In order to get this to work it should either be possible to either:

    a) force the upload - but there doesn't seem to be an option

    b) change the assembly version of the deployable package - but the UI does not seem to let you do it and I can't find a command line way of doing this

    c) empty the folder where the deployable packages are installed (which according the the blog I quoted earlier is in DMF Parameters

    Other than that, I think I have to create a new model every time.

  • Verified answer
    nunomaia Profile Picture
    25 Moderator on at

    You need to create a new model to avoid conflicts 

  • nspiteri Profile Picture
    545 on at

    that's the only solution I found.. its a bit silly but it works

  • nspiteri Profile Picture
    545 on at

    one other thing I found out - in your script don't put any prompts because since the test run automatically wraps the script around a tts, you'll get tts errors and cannot continue after that.

  • nunomaia Profile Picture
    25 Moderator on at

    yes, all code is wrapped under a TTS. That is the solution to simulate script. Execute code and rollback TTS in simulation mode. 

  • CU21031801-0 Profile Picture
    2 on at
    Even after creating the new Class, it shows the same error and we get block.
    This feature needs to be refine.

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

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 307 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans