Friday, November 15, 2024

CHE update failed on 10.0.41 for step 66 DVT script for service model: MROneBox on the machine

Problem

When trying to apply Version Update /Quality update PU65 (10.0.41) to build/Development Environment  it fails at MROneBox step 66.



To resolve the MR Problem, you can use the following workaround:

  1. Navigate to the deployable package directory: K:\DeployablePackages\<PackageGUID>\MROneBox\scripts\update
  2. Locate the AutoRunDVT.ps1 script:phpCopy code<ServiceVolume>:\DeployablePackages\<PackageGUID>\MROneBox\scripts\Update\AutoRunDVT.ps1
  3. Create a backup of the AutoRunDVT.ps1 file.
  4. Open AutoRunDVT.ps1, clear all its contents, and save the file.
  5. Resume the deployment process in Lifecycle Services (LCS).

This solution bypasses the DVT (Developer Validation Test) execution during deployment, allowing the process to complete successfully.

Tuesday, August 20, 2024

What are standard datatypes and extended data types in D365FO?

Microsoft Dynamics 365 Finance and Operations (D365FO), the standard datatypes and extended data types are critical for defining how data is stored, processed, and displayed within the system.

Standard Data Types:

These are the basic types provided by the X++ language in D365FO, similar to common programming languages. Some of the most commonly used standard data types include:

  1. Integer (int): Represents whole numbers.
  2. Real: Represents floating-point numbers.
  3. Boolean: Represents true or false values.
  4. Date: Represents calendar dates.
  5. Time: Represents time of day.
  6. DateTime: Represents a combination of date and time.
  7. String: Represents a sequence of characters or text.
  8. Enum: Represents an enumerated list of named constants.

Extended Data Types (EDTs):

Extended Data Types are user-defined types that extend the standard data types. They provide additional metadata, such as labels, help texts, and formatting, and can be reused across multiple tables, fields, and variables. EDTs add an abstraction layer over the base data types, making it easier to manage and maintain data integrity.

  • Usage: EDTs are used to define fields in tables, forms, reports, and queries. For example, an EDT named AccountNum might extend the String type but with additional constraints or formatting applied.

  • Custom Properties: EDTs can have properties like StringSize, Label, and HelpText to enhance the usability and consistency of data entry across the system.

  • Extension: EDTs can also be extended, allowing developers to modify properties like labels, string sizes, or help texts without modifying the original type. This is particularly useful in keeping customizations upgrade-safe.



Thursday, July 11, 2024

Error importing database: Error SQL72014:FINTAG_INSTEADOFINSERTTRIGGER Cannot insert an explicit value into a timestamp column.

ISSUE: Error importing database: Could not import package.

Error SQL72014: Core Microsoft SqlClient Data Provider: Msg 273, Level 16, State 1, Procedure FINTAG_INSTEADOFINSERTTRIGGER, Line 41 Cannot insert an explicit value into a timestamp column. Use INSERT with a column list to exclude the timestamp column, or insert a DEFAULT into the timestamp column.
Error SQL72045: Script execution error.  The executed script:
CREATE TRIGGER [dbo].[FINTAG_INSTEADOFINSERTTRIGGER]
    ON [dbo].FinTag
    INSTEAD OF INSERT
    AS BEGIN
           DECLARE @ErrorLevel AS INT = 0;
           DECLARE @Delimiter AS CHAR;
           DECLARE @IsDelimiterInValues AS BIT;
           DECLARE @ErrorDelimiter AS CHAR = '!';
           SELECT @Delimiter = CASE (SELECT DELIMITER
                                     FROM   FINTAGPARAMETERS
                                     WHERE  PARTITION = (SELECT PARTITION
                                                         FROM   INSERTED)) WHEN 1 THEN '|' WHEN 2 THEN '.' WHEN 3 THEN '_' WHEN 4 THEN '-' WHEN 5 THEN '~' ELSE @ErrorDelimiter END;
           SELECT @IsDelimiterInValues = CASE WHEN CHARINDEX(@Delimiter, concat(TAG01, TAG02, TAG03, TAG04, TAG05, TAG06, TAG07, TAG08, TAG09, TAG10, TAG11, TAG12, TAG13, TAG14, TAG15, TAG16, TAG17, TAG18, TAG19, TAG20)) > 0 THEN 1 ELSE 0 END
           FROM   inserted;
           DECLARE @Hash AS NVARCHAR (64);
           DECLARE @DisplayValue AS N



Solution: 
We have struggled with a Fintag error while trying to restore the UAT database. We opened a ticket to Microsoft, and thanks to them they showed us how to solve it.

1. Go to Feature Management and turn on the Financial Tags Feature


2. 
Go to the Data Maintenance and click "Check for updates".


3. Select data integrity, Run the "Deploy financial tag table triggers" Data Maintenance job (Clicking on including system action)

4. When the job finishes successfully, please take a new export Database and try restoring that one into the dev environment.

Wednesday, June 12, 2024

How to use free Microsoft Virtual Machine for Dynamics 365 Finance & Operations

We all understand what Dynamics 365 is and its usage. To understand it deeper and more practically, there needs to be a lab to practice it.

Microsoft provides this lab experience and related content for educational purposes and is intended solely for learning about the covered products and services.

VM Mode provides a free, web-based virtual machine environment to complete the steps in this unit. The link for accessing the lab


Login to VM
Click on 'Launch VM mode or Sign in to launch VM mode' in this unit.
In the Resources tab on the lab sidebar, select the T icon next to Password in the MININT box, to have the administrator password for the Virtual Machine entered for you.
Your mouse cursor will now be on the Password page.
On the Resources tab of the lab sidebar, below the Azure portal heading, select the T icon next to select Password, then press Enter.
Screenshot of the Password field the Enter password dialog box that appears. 
Don't stay signed in or store the password on the virtual machine.
Select Accept on the Permissions requested page.Screenshot of the Permissions requested page.
To see the lab instructions, select the Instructions tab on the lab sidebar.
You can now begin your work on this lab
.
Select Enter.
Microsoft Edge will open. Wait for it to navigate to the Sign-in page for finance and operations.
On the Microsoft Sign-in page in finance and operations, place your mouse cursor into the Username field.
On the Resources tab of the lab sidebar, below the Azure portal heading, select the T icon next to the Username, then press Enter.


For a basic login, use your credentials. Inside the VM, the specific credentials have been given in order with respect to the virtual machine.

Each and every step that needs to be followed is given in the link provided above.

This article is to understand that there are immense resources that are available for free for learning purposes, like this VM. I hope you will like it,

Friday, May 17, 2024

Dynamics 365 Finance and Operations -DB Restore- The permission 'KILL DATABASE CONNECTION' is not supported in this version of SQL Server.

Error message: Receive the following error while importing a BACPAC to a Dev environment

Error: 

*** Error importing database: Could not import package.

Error SQL72014: Framework Microsoft SqlClient Data Provider: Msg 4630, Level 16, State 1, Line 1 The permission 'KILL DATABASE CONNECTION' is not supported in this version of SQL Server. Alternatively, use the server level 'ALTER ANY CONNECTION' permission.
Error SQL72045: Script execution error.  The executed script:
GRANT KILL DATABASE CONNECTION TO [ms_db_configreader];

Some hints are helping us to resolve the issue.


1. Rename your Downloaded .bacpac file to .zip

Go to the folder where you have saved your BACPAC file and rename the BACPAC file with a .zip extension



Press "Yes" to convert the .bacpac file to zip file.


2. open the zip file and find the model.xml file inside, 


3. copy the model.xml it out to somewhere you like



4. Open the model.xml file in Notepad editor, which is pretty big.


5. Find string "Grant.KillDatabaseConnection" 



6. Delete the entire Element tag which contains " Grant.KillDatabaseConnection " 


7. After the deletion of the element type mentioned in 6. it looks like the below.



9. Rename the file modelCopy.xml  and paste it into the SqlPackage folder.


10. Rename the zip file to bacpac file  (reverting back the changes from 1)



11. Login to the command prompt as administrator. 


12. Navigate to the downloaded SQLPackage folder and run the below command.


Package Execution Command Script :

"J:\DBRestore\sqlpackage-win-x64-en-162.2.111.2\sqlpackage.exe" /a:import /sf:"J:\DBRestore\UATbackup.bacpac" /tsn:localhost /tdn:AxDB16052024 /TargetUser:axdbadmin /TargetPassword:LCSSQLPassword /TargetEncryptConnection:False /TargetTrustServerCertificate:True /p:CommandTimeout=30000 /mfp:"J:\DBRestore\ModelCopy.xml"

or

1)cd J:\DBRestore\\sqlpackage-win-x64-en-162.2.111.2

2) SqlPackage.exe /a:import /sf:"J:\DBRestore\UATbackup.bacpac" /tsn:localhost /tdn:AxDB16052024 /TargetUser:axdbadmin /TargetPassword:LCS SQL DB Password /TargetEncryptConnection:False /TargetTrustServerCertificate:True /p:CommandTimeout=30000 /mfp:"J:\DBRestore\ModelCopy.xml"
This steps resolve the issue of Importing the Bacpac file into D365 F&O Tier 1 environments

Wednesday, April 24, 2024

How to create a filter on display method using view Dynamics 365 Finance and Operations

Form fields that are based on display methods are not filterable, but in some cases, the client wants those fields filterable. There are two ways to make display fields filterable we will explain on this blog only the best way to do it (use best practice).

In our case Invoice Date field field into project expense journal form, invoice date is comes from projinvoicejour which is not part of our form. for this created view with ProjCostTrans and created method like below to get invoice date.


public class ProjCostTrans extends common
{
    private static str expensetransInvoicedate()
    {
        str expressionExp = strFmt(
            @"SELECT TOP 1 PROJINVOICEJOURlocexp.INVOICEDATE
                FROM %1 AS ProjProposalCostLoc
                JOIN %2 AS PROJINVOICEJOURlocexp
                ON PROJINVOICEJOURlocexp.ProposalId = ProjProposalCostLoc.ProposalId
                WHERE ProjProposalCostLoc.TransId = %3",
            (new SysDictTable(tableNum(ProjProposalCost))).name(DbBackend::Sql),
            (new SysDictTable(tableNum(PROJINVOICEJOUR))).name(DbBackend::Sql),
            SysComputedColumn::returnField(tableStr(ProjCostTrans), identifierStr(ProjCostTrans),
            fieldStr(ProjCostTrans, TransId)));
        return expressionExp;
    }
}

once method is completed, add view as data source in expense journal form and drag invoice date filed into grid.

How to calculate due date in x++?

////      for aging report

class Duedate_CustAging
{
    public static void main(Args _args)
    {
        CustTrans               CustTrans;
        CustInvoiceJour         custInvoiceJour;
        ttsBegin;
        while select forupdate custInvoiceJour where CustInvoiceJour.Payment =='Test'
                        && CustInvoiceJour.DueDate == CustInvoiceJour.InvoiceDate
                          //  && CustTrans.Invoice=='INV-0000001623'
        {
            CustInvoiceJour.DueDate = PaymTerm::find(CustInvoiceJour.Payment).due(CustInvoiceJour.InvoiceDate);
            CustInvoiceJour.update();
        }
        ttsCommit;
    }
}

////      for Cust Trans
class DuedateCusttrans_OpenClass
{
    public static void main(Args _args)
    {
        CustTransOpen       CustTransOpen;
        CustTrans           CustTrans;
        
        ttsBegin;
        while select forupdate CustTransOpen join CustTrans where CustTrans.RecId == CustTransOpen.RefRecId 
                    && CustTrans.AccountNum == CustTransOpen.AccountNum 
                    && CustTrans.PAYMTERMID ==CustParameters::find().CustPaymTermId
                    && CustTransOpen.DueDate == CustTransOpen.TransDate  && CustTrans.Invoice !=''
                    //  && CustTrans.Invoice=='INV-0000001623'
        {
            CustTransOpen.DueDate = PaymTerm::find(CustTrans.PAYMTERMID).due(CustTransOpen.TransDate);
            CustTransOpen.update();
        }
        
        ttsCommit;
        
        info('Due date has been Updated');
    }

}


Monday, March 18, 2024

How to Fix the Error: “A Reference Is Required to Compile This Module” In Dynamics 365 Finance and Operations

Error: A reference to 'Dynamics.AX.ApplicationFoundation, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' is required to compile this module. CUSModel (VAR) [CUS]

This error indicates we’re trying to modify/reference code from a model (Application Foundation) other than the current model (CUS) and a reference isn’t set up between the two. 

To fix this error, navigate to Dynamics 365 > Model Management > Update model parameters.



Select the current model. The model name is “CUS” in this case. The details related to the model will be populated on the “Update model parameters” form.



Now click Next and select the model that needs to be referenced.



Once all the related models are selected, click Next and follow the dialog.

Tuesday, March 12, 2024

Data Retrieval from Various Tables via HcmWorker in Dynamics 365 Finance and Operations

Get HcmWorker Table from Personnel Number: 

HcmWorker hcmWorker = HcmWorker::findByPersonnelNumber('00001');

Get Active HcmEmployment Table from HcmWorker Record Id:

HcmEmployment hcmEmployment = HcmEmployment::getActiveEmploymentsByWorker(hcmWorker.RecId);

Get DirPerson Table from HcmWorker:

DirPerson person = hcmWorker.DirPerson();

Get DirPersonName Table from DirPerson Record Id:

DirPersonName dirPersonName = DirPersonName::find(person.RecId);

Get HcmPersonPrivateDetails Table from DirPerson Record Id:

HcmPersonPrivateDetails personDetails = HcmPersonPrivateDetails::findByPerson(person.RecId);

Get HcmPositionWorkerAssignment Table from HcmWorker Record Id:

HcmPositionWorkerAssignment positionWorkerAssignment = HcmPositionWorkerAssignment::getActivePositionWorkerAssignment(hcmWorker.RecId);

Get HcmPositionDetail Table from HcmPositionWorkerAssignment Position:

HcmPositionDetail hcmPositionDetail = HcmPositionDetail::findByPosition(positionWorkerAssignment.Position);

Get HcmPositionHierarchy Table from HcmPositionWorkerAssignment Position:

HcmPositionHierarchy positionHierarchy = HcmPositionHierarchy::findByPosition(positionWorkerAssignment.Position);

Get HcmPositionWorkerAssignment Table from HcmPositionHierarchy ParentPosition:

HcmPositionWorkerAssignment parentPositionWorkerAssignment = HcmPositionWorkerAssignment::findByPosition(positionHierarchy.ParentPosition);

Get LogisticsPostalAddress Table from DirPerson Record Id:

LogisticsPostalAddress logisticsPostalAddress = DirParty::primaryPostalAddress(person.RecId);

Get HRMCompFixedEmpl Table from HcmWorker Record Id and HcmPositionWorkerAssignment Position:

HRMCompFixedEmpl fixedCompensation = HRMCompFixedEmpl::findMostRecentFixedCompensation(hcmWorker.RecId, positionWorkerAssignment.Position);

Get JmgEmployee Table from HcmWorker Record Id:

JmgEmployee jmgEmployee = JmgEmployee::find(hcmWorker.RecId);

Get HcmPersonDetails Table from DirPerson Record Id:

HcmPersonDetails hcmPersonDetails = HcmPersonDetails::findByPerson(person.RecId);

Get HcmPositionType Table from HcmPositionDetail Position Type:

HcmPositionType hcmPositionType = HcmPositionType::find(hcmPositionDetail.PositionType);