Sunday 20 December 2020

Version "Vendor invoice workflow - v5" already exists. Import has been canceled AX 2012/ D365F&O

 I was getting the bellow error while trying to import the workflow configuration from DEV to UAT.


Version "Vendor invoice workflow - v5" already exists. Import has been canceled.


Usually you see this error when the work configuration is having the same version number. 

Ex: 5.0.0.0


Solution:

--------------

-> Open the workflow configuration file(XML) in notepad/notepad++

-> Search for "versionIdMajor" attribute/field in the XML. Usually, you find it in the end of the XML file.

-> Update the versionid number to higher number.

Ex: In  my case the previous number was 5 and I updated it to 6.




That's it


@Rahul


Sunday 13 December 2020

D365 Finance VSTS/ azure devops DB sync fails / [error]SYNCENGINE(0,0): Error Number: -2,State:0,Class:11/ C:\DynamicsSDK\Metadata\SyncEngine.proj] Database synchronization failed

 While working with the D365 F&O build server, we suddenly started to get the timeout error on the database synchronization step. Checking the logs on the azure dev ops pointed out that, db sync was not able to complete the login phase for the sql server. 

 
This was odd, as the builds have been working fine until this point. This was a wild goose chase to check the settings of the sql server, hosts file, testing pings etc …
 

Build failed:

2020-02-23_14-54-38
 
This started happening after we took 10.0.14 quality update, or it was co-incidence – we are not sure yet.

Resolution:

 
It came down to the “Auto close” was set to “True”, after changing that to “False”, we can see that now builds are getting done successfully.

Connect to Cloud hosted build server and open SSMS - Sql server management studio and connect to AxDB.

If in case AxDB in recovery mode run the below query to set it normal.

ALTER DATABASE AxDBSET MULTI_USER;
GO


Now, right click on AxDB and go to properties -> Go to potions and set Auto close false.






or you can run below query to set auto close off.

ALTER DATABASE [AxDB] SET AUTO_CLOSE OFF;

@Rahul

for more details please refer below link.

https://rizworks.wordpress.com/2020/02/23/d365-fo-dbsync-error-errorsyncengine00-error-number-2state0class11/

Thursday 10 December 2020

Trial balance is not matching with all transactions in dynamics ax 2012 or Dynamics 365 finance

 This is a very common problem that some times the trial balance debit/credit would not match with all transactions. Usually, you see this issue during year end closing. 


The same thing happed to me as well. I checked all the reports ex: ledger transactions and dimension statement reporta and all the transactions looks correct but still not matching with the trial balance.


Solution : Rebuild financial dimension set solved my problem. 







@Rahul


I found below post and this will give you more details about the issue. Hope this helps! 

https://community.dynamics.com/365/financeandoperations/b/dynamics-365-finance-blog/posts/best-practices-for-updating-financial-dimension-set-dimension-sets


Financial dimension sets allow you to create a combination of the main account and financial dimensions, and the order of them for analyzing balances on the Trial balance list page and various reports.

 Image

 

When you first create a financial dimension set, you must select Create balances before it can be selected for analysis. Once the balances are created, they can be selected in various report and inquiry screens.

Image

 

There are two options available on the Financial dimension sets for balances once they are created.

  • Update balances – update will take any records that have not been added to the balances yet and update them. This is a net new update.

  • Rebuild balances – rebuild will completely clear the balance and new records and recreate the balance from the beginning of time.

 

You can schedule periodic updates for the balances, but also note that some reports or inquiries will run the update during processing. For example, on the Trial balance list page, when you click Update, it runs an Update balances for that financial dimension set.

 

So how do you know if you should schedule updates or rebuilds? Let’s cover some best practices for this process:

 

  1. Only create the financial dimension sets you need and use. Otherwise you are just using up time and resources to rebuild and/or initialize something that is unnecessary. For example, if you are never going to analyze the combination of Main account and cost center, do not create it as a Financial dimension combination. Processes such as Year end close or consolidation rebuild all financial dimension sets during their processing, and this can add significant time to the process.

  2. Rebuild balances only if needed, such as a last attempt at troubleshooting if you don’t think the balance is right or are missing a transaction in the balance.

  3. Schedule Update balances periodically, as if you do large postings or imports, so that the new records are committed to the balance. It is best to schedule this during off-peak hours.

  4. It is not recommended to schedule Rebuild balances unless you identify a situation and feel it needs to become a periodic process. If you must schedule a rebuild, it is highly recommended to do it infrequently (perhaps monthly), and at a time when there is no other processing on the system


Thursday 3 December 2020

The SMTP server requires a secure connection or the client was not authenticated. The server response was: Authentication required in Dynamics 365 Finance / Dynamics AX

 I was getting the below error while try to send a test email through email parameters after updating SMTP details.


The SMTP server requires a secure connection or the client was not authenticated. The server response was: Authentication required


Solution

------------------

-> After updating the SMTP detail refresh the application page and try again

-> If the above steps does not work, login with send as email address (ex: noreply@abc.com) and update the SMTP details and send a test email.

Friday 20 November 2020

SQL query to get vendor email addresses and phone details in ax/d365 x++

Below is the sql query to get vendor email address. Please change it according to your requirement.



select VENDTABLE.ACCOUNTNUM as VendorId, DIRPARTYTABLE.NAME, LogisticsElectronicAddress.DESCRIPTION as Type,LogisticsElectronicAddress.LOCATOR as Email , LogisticsElectronicAddress.ISPRIMARY, LogisticsLocationRole.TYPE, DIRPARTYLOCATION.PARTY, VENDTABLE.dataareaid from VENDTABLE 

join DIRPARTYLOCATION on VENDTABLE.PARTY = DIRPARTYLOCATION.PARTY

join LogisticsElectronicAddress on DIRPARTYLOCATION.LOCATION = LogisticsElectronicAddress.LOCATION

join LogisticsElectronicAddressRole on LogisticsElectronicAddress .RecId = LogisticsElectronicAddressRole .ElectronicAddress

join LogisticsLocationRole on LogisticsElectronicAddressRole.LocationRole = LogisticsLocationRole .RecId

join DIRPARTYTABLE on VENDTABLE.PARTY = DIRPARTYTABLE.RECID

where LogisticsElectronicAddress.TYPE = 2 // address 1 is phone number

// where LogisticsElectronicAddress.ISPRIMARY = 1 // for primary contacts only // 0 for non primary

order by VENDTABLE.ACCOUNTNUM



Sunday 27 September 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 8 September 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 31 August 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 5 August 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 23 June 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 17 May 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 13 March 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 19 February 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 18 February 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 7 February 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







Friday 24 January 2020

Couldn't retrieve the data for this visual.Please try again later or contact support. If you contact support, please provide these details Power BI Dynamics 365 Finance & Operations

I was getting the below error while trying to access the CFO BI screen.

Couldn't retrieve the data for this visual.Please try again later or contact support. If you contact support, please provide these details

Reason: BI reports are not deployed.

Solution :


Go to  System administration -> Setup -> Entity store and select all/required entities and click on refresh.


Wait until it is refreshed (A record will appear in the refresh log). You may also verify that "Full reset" batch job is enabled and check its recurrence.
In my case I selected all entities and refreshed them.
Go back to the CFO screen and check the BI reports again.
Also, make sure all the settings are configured properly. Ex: App registration, Client and secret is configured in D365 F&O .
@Rahul



Wednesday 22 January 2020

Sales Tax code must be entered if the account is a Sales Tax account in Dynamics 365 F&O

I was getting the below error while trying to post a vendor invoice with the sales tax.

Sales Tax code must be entered if the account is a Sales Tax account


Reason: Sales tax code is required when you post a transaction with sales tax group.

Solution 1
Go to persolization and add "sales tax code" to the vendor invoice lines screen and select the tax code. Most of the case it should be same as the sales tax group. Then, post the invoice.



Solution 2:
You may also see this error when you are using a sales tax type ledger account in the GL entry and trying to make an adjust/reversal.

To allow/post the entry you will need to disable the sales tax validation on the ledger account which you are tying to make an adjustment

Go to GL -> Chart of account -> accounts -> main accounts
Filter the ledger account -> Posting validation -> And change the sales tax to blank





Now, you can post the GL entry.   After posting the journal entry, remember to change back the configuration to the “Sales tax” in the posting type field.




For more details : https://support.rocksolid.com/hc/en-us/articles/360045430451-D365-Error-sales-tax-code-must-be-entered-if-account-number-is-a-sales-tax-account

The ledger posting group does not have an account for sales tax direction sales tax receivable specified in Dynamics 365 F&O

I was getting the below error while trying to post a vendor invoice.

The ledger posting group does not have an account for sales tax direction sales tax receivable specified

Reason:

"Sales tax receivable" is not filled in for the tax code in "Ledger posting groups"

Solution:

Fill the "sales tax receivable" with the right GL code as shown below.




@Rahul

Adding a newline into a string in C# and X++

Below is the sample code we can use for  adding a newline after every occurrence of "@" symbol in the string in C#   using System...