Thursday, February 6, 2025

Fix Dynamics 365FO Synchronization Error - Transaction Log Full

Fix Dynamics 365FO Synchronization Error - Transaction Log Full

Fix: The transaction log for database is full due to 'log_backup' - Dynamics 365FO

If you're encountering the error "The transaction log for database is full due to 'log_backup'" while working with Dynamics 365 Finance and Operations (D365FO), it means your SQL Server transaction log has reached its maximum capacity.

Solution

Follow these steps to resolve the issue:

Step 1: Check the Database Files

Run the following SQL query to check the database file details:

    SELECT * FROM sys.database_files
    

Note down the log file name from the result and use that same name in the second statement of the step 2 SQL query.

Query result screenshot:

Database files query result

Step 2: Shrink the Transaction Log

Execute the following commands to shrink the transaction log and free up space:

    ALTER DATABASE AxDB SET RECOVERY SIMPLE;
    DBCC SHRINKFILE('AxDb_New_log', 0, TRUNCATEONLY);
    ALTER DATABASE AxDB SET RECOVERY FULL;
    

Replace 'AxDb_New_log' with the actual log file name you noted earlier.

Step 3: Start DB synchronization again...this time it should work

..

Follow "Dynamics World" blog also for some other approach

Tip: Always ensure you have proper database backups before making changes to recovery models.

Wednesday, January 22, 2025

Get Description of financial dimension value from SQL DB of D365FO

Retrieve Financial Dimension Value Description using SQL Query in D365FO

How to Retrieve Financial Dimension Value Description with SQL in D365FO

In this post, we will explore how to retrieve the description of a financial dimension value in an ERP or financial management system using a specific SQL query in D365FO.

The Query


SELECT DIMATTVALUE.DISPLAYVALUE AS 'DIMENSIONVALUE',
       DIMATT.NAME AS 'FINANCIALDIMENSION',
       DIMATTVALUE.ISSUSPENDED,
       HCMWORKER.PERSONNELNUMBER AS 'OWNER',
       DimFinTag.DESCRIPTION
FROM DIMENSIONATTRIBUTEVALUE AS DIMATTVALUE
LEFT JOIN HCMWORKER ON DIMATTVALUE.OWNER = HCMWORKER.RECID
JOIN DIMENSIONATTRIBUTE AS DIMATT ON DIMATT.RECID = DIMATTVALUE.DIMENSIONATTRIBUTE
JOIN DIMENSIONATTRIBUTEDIRCATEGORY dimAttDirCategory 
ON dimAttDirCategory.DIMENSIONATTRIBUTE = DIMATTVALUE.DIMENSIONATTRIBUTE
JOIN DIMENSIONFINANCIALTAG DimFinTag ON DIMATTVALUE.DISPLAYVALUE = DimFinTag.VALUE 
AND DimFinTag.FINANCIALTAGCATEGORY = dimAttDirCategory.DIRCATEGORY
WHERE DIMATTVALUE.ISDELETED = 0
  AND DIMATTVALUE.ISSUSPENDED = 0
        

Feel free to leave a comment below if you have any questions or need further clarification on the query or its results!

Monday, January 13, 2025

Call custom service with JSON body in D365FO

Call Custom Service with JSON Body in D365FO

Call Custom Service with JSON Body in D365FO

        
FileUploadTemporaryStorageResult fileUpload = File::GetFileFromUser() as FileUploadTemporaryStorageResult;
System.IO.Stream stream = fileUpload.openResult();
str responceJson;

using (var reader = new System.IO.StreamReader(stream))
{
    responceJson = reader.ReadToEnd();

    TESTPOReceiptRequestContract contract = FormJsonSerializer::deserializeObject(
        classnum(TESTPOReceiptRequestContract), responceJson);

    new TESTPOReceiptService().processRecord(contract);
}
        
    

Fix Dynamics 365FO Synchronization Error - Transaction Log Full

Fix Dynamics 365FO Synchronization Error - Transaction Log Full Fix: The transaction log for database is f...