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







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