Thursday, June 12, 2025

D365 F&O Tier 1 Update Failure Step 25 AOSService

When upgrading a tier 1 environment you could receive the following error:

GlobalUpdate script for service model: AOSService on machine

This usually means an issue with the DB sync, however, the log zip file doesn't always contain a file indicating the error.  Here are some steps to fix this issue:

  1. Ensure VS 2022 is fully upgraded.
    1. If you had to upgrade VS 2022, uninstall D365 F&O extension
    2. Re-install extension from K:\DeployablePackages\                                    [ID]\DevToolsService\Scripts\Microsoft.Dynamics.Framework.Tools.Installer.17.0
  2. Full compile of ALL modules
  3. DB Sync
  4. Restart environment
  5. 'Resume' upgrade



Wednesday, June 11, 2025

D365 F&O Service Update failure DevToolsService

Recently when upgrading tier 1, cloud hosted, environments from 10.0.41 to 10.0.42,43, or 44 I received the following error:
 
Update script for service model: DevToolsService on machine

On some of my environments I would receive an error indicating it couldn't find VS 2022 and others that had VS 2022 it was another error.  
In order to get past this I would do the following:

  1. If missing VS 2022, install it.
    1. If it is already installed, update it.
    2. Remove the D365 F&O extension if it is installed.
  2. Install D365 F&O extension from K:\DeployablePackages\[ID]\DevToolsService\Scripts\Microsoft.Dynamics.Framework.Tools.Installer.17.0
  3. In the same 'Scripts' folder, run the powershell command '.\AutoUpdateDevToolsService.ps1'
  4. If that is successfull, copy and make a duplicate of that command.
  5. Delete all code in the original .ps1 file and then resume your service update.


Wednesday, May 21, 2025

Vendor record creation DirPartyTable lookup / creation by name.

 We have a custom vendor creation form but needed it to behave similarly to the standard VendTable form when creating a new vendor and selecting or creating a party.  In order to do this you need to join 'DirPartyTable' to your master record table as datasources in the form, add the 'DirPartyTable' name field as a control and then add the following code.

At the form level, add this variable:



On 'init' of the form, initialize the variable and setup the parms:




On 'createRecord' of the form:





I comment out super as my form is for creation only.

And finally, you will need this parm method in order for the selected 'DirPartyTable' record to come back to your datasource:





That's it!  You can now use the full functionality of looking up 'DirPartyTable' records by name.

Wednesday, March 12, 2025

D365 F&O Email distributor batch add CC

 Well, it has been a while since my last post... So here go...

I recently had the requirement to have CC ability with our emails that I am created via code. We, however, use the SysOutgoingEmailTable and Email templates to send our emails.  The SysOutgoingEmail has no CC field.

Here is my solution.

Create a new extension and add a new field (I created an EDT that extends SysEmailRecipients) to the SysOutgoingEmailTable.

Create extension of SysEmailDistributor class and create chain of command call on initializeMessageBuilder method.


In this chain of command, use the messageBuilder object to 'addCc'.  I also break my field up by ';' because I will have, potentially, multiple email addresses.

Lastly, you need to create your own class and batch job to run for this:


I'm not sure why, but the chain of command isn't enough as the standard SysEmailDistributor won't pick it up. Once you create your own class and a batch jobs, you are all set.
You then simply need to populate your custom field with the CC addresses when creating your email in your code.

That's it!


Wednesday, May 1, 2024

D365 F&O - When posting Service Orders, Project Item Journals, Item Transfer Journals, A key with the name 0.00 already exists.

 Recently we ran into an issue when posting Service orders, project item journals, or item transfer journals with multiple lines.  The error we received is:

Check - Journal Journal: 000341 A key with the name 0.00 already exists.

In looking deeper, it seemed that the issue was a violation of the primary key on the InventJournalTrans table that is associated with the voucher.  The actual error is occuring in classes\JournalTransList\selectDB class\method.  Inside that class the 'add' method is called and when calling 'ins' on a RecordInsertList it is failing.

In doing some searching I found a post for AX 2009 here.  This post is nearly 15 years old!  However, my situation is the exact same.  I have an extension of the InventJournalTrans where I added the SMAServiceOrderLineNum field which extends the 'LineNum' EDT.  This was causing the system to think my custom field was part of the index and therefore throwing the error on multiple lines.

Solution:

As mentioned in the link, create your own Real EDT that extends 'LineNum' and use that for your field on the table.

Thursday, March 21, 2024

Power Automate Looks like your flow's connection needs to be signed-in again

 Yesterday one of my Power Automate cloud flows started fail with the following message:

Looks like your flow's myemail@mywork.com connection needs to be signed-in again. The most common cause is a changed password or a policy set by your tenant administrator. Connections may also require reauthentication, if multi-factor authentication has been recently enabled for your account.

I didn't have a password change nor did I enable MFA.  It could have been a policy change in our tenant, however, my infrastructure team hasn't been able to confirm.  

I was able to fix the issue by logging into make.powerautomate.com in a Chrome incognito window.  Once I logged in I was showin this:


These are the 3 cloud flows that I have created.  Once I hit 'Reauthenticate' I was then taken to:

I clicked 'Fix connection' on each item and completed a short logon procedure.  This fixed the issue.
This blog post was helpful in understanding what possible causes were and the solution.






Wednesday, September 13, 2023

Dataverse web api 'Expand'

Today, I was attempting to use the 'Expand' feature in the web api to help me with a lookup field on my custom dataverse table.  No matter what I did, I could get it to work.  It kept telling me that my property 'ver_dataareaid' didn't exist on my table.  It, obviously, did so I knew I was doing something wrong.  When using the 'Expand' you need to use the Schema name of the field:




As you can see, the 'Schema name' can be found under the 'Advanced options' when you 'Edit' the column.  This gave me the actual 'Name' value of the column rather than a guid from the lookup.