Sunday, September 27, 2020

Error importing database: could not load package from dynamics 365 'D:\Exportedbacpac\swelltestupgradebackup.bacpac'. File contains corrupted data.

 I was getting the below error while trying to import database into DEV environment.


Error importing database: could not load package from dynamics 365 'D:\Exportedbacpac\swelltestupgradebackup.bacpac'. File contains corrupted data.


Solution:

-> Go to below link and download "Windows .NET Core" Zip file and extract it to C:\Temp.

https://docs.microsoft.com/en-us/sql/tools/sqlpackage-download?view=sql-server-ver15


From there, instead of using the Sqlpackage.exe under C:\Program Files (x86), please use the Sqlpackage.exe in C:\Temp\Sqlpackage-dotnetcore


Your import query will look like below

C:\Temp>SqlPackage.exe /a:import /sf:D:\Exportedbacpac\Testupgradebackup.bacpac /tsn:localhost /tdn:AxDB_fromProd1 /p:CommandTimeout=0

Tuesday, September 8, 2020

Class names when you validate or simulate a vendor payment journal in dynamics AX/ 365 finance and operations

 Below is the class name when you validate a vendor payment journal.

LedgerJournalCheck


Below are the class name when you simulate a vendor payment journal.

LedgerJournalPost

LedgerJournalCheckPost

LedgerJournalTransUpdateVend


Monday, August 31, 2020

Cannot merge branches due to "incompatible pending change" in VSTS Dynamics 365 Finance and operations

I  Was getting the below error while trying to merge the DEV branch changes to Main branch. In my case, the DEV branch was newly created after the PU upgrade (10.0.12) and trying to merge the new changes to Main. I was doing the merger in my Development remote server.

The item $/D365FO/Trunk/Main/ has an incompatible pending change. See output tool window for information on any other errors.

Reasons:

-> The main branch is not having the latest code of that object

-> Any pending changes to check in for that particular object in Main branch and trying to merge the code for the same object from DEV.


Solution:

-> Check-in any pending changes in Main branch

-> Download the latest changes from Main branch

-> Make sure there are no pending changes to check-in

-> Now, perform the code merger from DEV to MAIN.

@Rahul


How to get packing slip number of a customer invoice in D365FO/AX X++

 Sometimes, we may get a requirement to dispalay/get packing slip numbers of customer invoices. I wrote a simple query to get the details from the database. 

If you want to use this query in AX, create a display method in CUSTINVOICEJOUR table and change the code as per your requirement and add it to your SSRS report or user interface.

select CUSTPACKINGSLIPTRANS.PACKINGSLIPID,CUSTPACKINGSLIPTRANS.DELIVERYDATE as PackingslipDate, CUSTINVOICEJOUR.INVOICEID, CUSTINVOICEJOUR.INVOICEDATE, CUSTINVOICEJOUR.SALESID from CUSTINVOICEJOUR

join CUSTINVOICETRANS on CUSTINVOICEJOUR.INVOICEID = CUSTINVOICETRANS.INVOICEID 

and  CUSTINVOICEJOUR.INVOICEDATE = CUSTINVOICETRANS.INVOICEDATE

and CUSTINVOICEJOUR.SALESID = CUSTINVOICETRANS.SALESID

join  CUSTPACKINGSLIPTRANS on CUSTINVOICETRANS.INVENTTRANSID = CUSTPACKINGSLIPTRANS.INVENTTRANSID

               and CUSTINVOICETRANS.SALESID = CUSTPACKINGSLIPTRANS.SALESID

where CUSTINVOICEJOUR.DATAAREAID = 'ABC'-- data area id code

 and CUSTINVOICEJOUR.INVOICEDATE between '2019-12-29 00:00:00.000' and '2020-01-31 00:00:00.000' -- YYYY-MM-DD


@Rahul

Wednesday, August 5, 2020

D365 : An internal error occurred while connecting to the development environment in cloud remotely

I was getting the below error while trying to connect to my clud hosted DEV environment. 


An internal error has occurred 



Reason: Usually we see this problem when our laptop/system network drives updated.

Solution:

-> Stop and start your dev environment from LCS page.
-> Restart your laptop/computer and make sure the Microsoft updates installed successfully.
-> Restart your wifi/internet as well.


Tuesday, June 23, 2020

Remove diacritics (accents) from a strings in AX/D365 X++

There will be some cases where you need to remove accents from the strings before you post the data to endpoints/API's. Otherwise they may reject during the process.

I found the below post what exactly I was looking for. I was posting the 3PL information to the warehouse endpoint and they were rejecting the files where there were some accents in the addresses/delivery names.


The below code helped me to solve the problem. Please change the code according to your requirement.



static void AlexRemoveDiacritics(Args _args)
{
    str strInput = 'ÁÂÃÄÅÇÈÉàáâãäåèéêëìíîïòóôõ£ALEX';
    System.String input = strInput;
    str retVal;
    int i;

    System.Char c;
    System.Text.NormalizationForm FormD = System.Text.NormalizationForm::FormD;
    str normalizedString = input.Normalize(FormD);
    System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();

    for (i = 1; i <= strLen(normalizedString); i++)
    {
        c = System.Char::Parse(subStr(normalizedString, i, 1));

        if (System.Globalization.CharUnicodeInfo::GetUnicodeCategory(c) != System.Globalization.UnicodeCategory::NonSpacingMark)
        {
            stringBuilder.Append(c);
        }
    }

    input = stringBuilder.ToString();
    input = input.Normalize();
    retVal = input;

    retVal = System.Text.RegularExpressions.Regex::Replace(retVal, @"[^\w\.@-]", " ");// This
// will remove any non-printable ASCII characters from a string

info(strFmt("Before: '%1'", strInput)); info(strFmt("After: '%1'", retVal)); }



Sunday, May 17, 2020

Account number for transaction type Vendor cash discount does not exist' error while trying to post a payment journal in D365 Finance & Operations

I was getting the below error while trying to post a payment journal in Accounts Payable.

Account number for transaction type Vendor cash discount does not exist.

Reason: 

In my case, the payment is $4,500 and the marked invoices are $5000 which is more than my payment.
Due to that I was getting the error.

Solution:
Mark the invoices with $4,500 and post the payment journal.
 or 
Post the payment journal and later settle the invoice with payment.


@Rahul Talasila

What is the primary purpose of using a Solution in Microsoft Power Platform & ALM?

As organizations embrace low-code development with Microsoft Power Platform , it becomes essential to manage and govern apps, flows, and dat...