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

Friday, March 13, 2020

There was an error downloading 'https://D365applicationaos.cloudax.dynamics.com/soap/services/SWaifServices?wsdl/$metadata'. The request failed with an empty response. Metadata contains a reference that cannot be resolved: 'https://swelldev102dce1a4c63e35cbbdevaos.cloudax.dynamics.com/soap/services/SWaifServices?wsdl'. The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.

I was getting the below error while trying to download D365 services in SOAP reference.

There was an error downloading 'https://D365applicationaos.cloudax.dynamics.com/soap/services/SWaifServices?wsdl/$metadata'.

The request failed with an empty response.

Metadata contains a reference that cannot be resolved: 'https://D365applicationaos.cloudax.dynamics.com/soap/services/SWaifServices?wsdl'.

The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.

Reason:

Usually, we see this error when parameters in the service class is not matching or having duplicates in the parameters.




Solution:

Make sure the parameters should be unique and matching with method parameters.



Please see my previous post as well
https://rahulmsdax.blogspot.com/2019/08/there-is-problem-with-server-sorry.html

Wednesday, February 19, 2020

Inventory module parameters cannot be deleted while dependent Price history exist. Delete dependent Price history and try again.



Error: I was getting the below error while trying to delete a product master.

Inventory module parameters cannot be deleted while dependent Price history exist. Delete dependent Price history and try again.

Solution: 

Delete Product from the MCRPriceHistory table from AOT. After that delete it from the Released product and All Product and Product master.


delete MCRPriceHistory where MCRPriceHistory.ITEMRELATION = 'Product_Number'

@Rahul

Tuesday, February 18, 2020

How to Get the legal entity(current company) address in D365 / AX 2012 based on the Address Type

Below is the piece of code will return the current company address based on role type.



LogisticsAddressing  address;
    
    ;
    
    address = DirParty::findPostalAddressByRole(CompanyInfo::current(), LogisticsLocationRoleType::RemitTo).Address;

    info(address); 


@Rahul

Friday, February 7, 2020

A reference to 'Dynamics.AX.FinanceInsightsContracts, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' is required to compile this module in Dynamics 35 F&O

I was getting the below error after upgraded my build server to 10.0.8 (PL32) version and trying to build a new deployable package.

dynamics://Table/AVA_MiscChrgTransTable/Method/`insertCustInvoiceData(105,5) - A reference to 'Dynamics.AX.FinanceInsightsContracts, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' is required to compile this module


##[error]C:\DynamicsSDK\Metadata\Microsoft.Dynamics.AX.Application.Build.targets(40,5): Error : Error: dynamics://Table/AVA_MiscChrgTransTable/Method/`insertCustInvoiceData(105,5) - A reference to 'Dynamics.AX.FinanceInsightsContracts, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' is required to compile this module.

Reason: In 10.0.8 version Microsoft added a new package "FinanceInsightsContracts" and my custom model is missing the new package reference.

Solution: Need to update the custom model with "FinanceInsightsContracts" using "Update model parameters" and checkin the code into the VSTS. And, kick off the new build.

@Rahul







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...