Monday, March 28, 2022

D365 Browse OData entities with simple URL

Microsoft Dynamics 365 for Finance

If you quickly want to see entity records using OData, just add /data/[Public collection name] to the environment URL!
https://yourenvironment.dynamics.com/data/Customers

Sunday, March 20, 2022

D365 WHS app get current worker user id

Microsoft Dynamics 365 Warehouse Management app

When you want to get the current WHS session worker user id using x++.

#WHSRF public static WHSUserId getCurrentWHSUserId() { WhsrfPassthrough pass = controller.parmSessionState().parmPass(); WHSUserId userId; if (pass.exists(#UserId)) { userId = pass.lookup(#UserId); } }

Friday, March 11, 2022

Deploy error "Cannot edit a record in Batch job"

Microsoft Dynamics 365 for Operations & Financials

Encountered a problem when deploying an ISV the other day.
03/11/2022 10:29:31: Infolog diagnostic message: 'System Job should be scheduled to run within 7 day(s) of last execution time' on category 'Error'.
03/11/2022 10:29:31: Infolog diagnostic message: 'Recurrence validation failed' on category 'Error'.
03/11/2022 10:29:31: Infolog diagnostic message: 'Cannot edit a record in Batch job (BatchJob).
The corresponding AOS validation failed.' on category 'Error'.
03/11/2022 10:29:40: Application configuration sync failed. Microsoft.Dynamics.AX.Framework.Database.TableSyncException: Custom action threw exception(s), please investigate before synchronizing again: 'ErrorException:Cannot edit a record in Batch job (BatchJob).


I found a solution in the dynamics community:

Step 1 : Select * from classidtable where name = 'SysFeatureTranslationPopulationBatch'
Step 2 : Get the ID, and Run --> Select batchjobid from batch where classnumber = RecId
Step 3 : Get the batchjobid, and Run --> Select * from BATCHJOB where RECID = batchjobid
Step 4: Update Batchjob set enddatetime=getdate()-1 where recid = batchjob RecId