Quantcast
Channel: Microsoft Dynamics 365 Community
Viewing all 10657 articles
Browse latest View live

Good practices with Code Deployment Dynamics ax 2012

$
0
0

This is not my original blog, but i have found very good comment from Tommy Skaue on community related code deployment and i really like to make it part of my blog so all should be aware of the best practices. This is about the modelstore installation to different environment and practices we need to following during code deployments.

1. Production

Always move changes to production from a Staging/Test/User Acceptance Testing environment. Move the entire ModelStore, precompiled X++ and CIL without any errors. Install it first to a temporary database schema (http://yetanotherdynamicsaxblog.blogspot.no/2013/02/deploy-modelstore-with-less-downtime.html), then take all the PROD AOSes down, then apply it, then start 1 AOS and run a data dictionary synchronize  Then start any other AOSes pointing at PROD.

2. User Acceptance Test (UAT)

Given a single test environment, you will install changes to this environment using models. There are scenarios where XPO is ok, which I will comment down below.
Given a separate build environment for test, you will move code to UAT using modelstore from build to UAT. In a perfect world, you will never install a model in UAT that has compile errors or dependency issues. Remember that whenever you install a model and need to run compile + synchronize  this process will take hours. Schedule it outside testing hours or consider setup a build environment.

Code is moved from here to Production using modelstore. Data is updated from Production to UAT. Environment IDs are shared, except from any new IDs introduced in UAT waiting to be shipped to Production.

3. Development

Some customers will accept having a customer specific developer environment, which allows us to develop customer specific customization without interfering with test. This is highly recommended. Here you will install updated models, your own and third party models, update customer specific models, merge code and compile. You can move code into this environtment using both models and XPO.

You may schedule a restaging of the data and the code in Development, meaning you backup the UAT database(s) and restore them over Development. Remember to backup the models in Development (http://yetanotherdynamicsaxblog.blogspot.no/2012/09/using-powershell-to-backup-your-ax-2012.html), in case someone forgot they had super important code in Development that wasn’t already shipped to UAT.

Over time the IDs in Development will stray away from Prod and UAT, so never move a modelstore from Development upwards without knowing what you are doing.

Models vs XPO

There are scenarios where XPO is an easy and convenient way to move code from A to B.
One clue is to know when introducing changes causes new IDs to be created. At this point, you need to know if this newly created ID will cause your UAT/Test and Prod to have different ID for the same element. If that happens, you’ve lost control and you need to restate UAT/Test again completely from Prod.
Another clue is when your XPO contains an element that contains changes bound to multiple AX models. Remember the XPO does not contain information of what change is bound to what model, so whatever you import using XPO will bind that change to the model you are currently working in. This may cause changes to be bound to a wrong model cause all sorts of havoc and issues later down the road.

So actually, you can move small changes to existing methods using XPO without introducing IDs if those changes all reside in the same model you exported the XPO from, if you catch my drift. You can also move SSRS reports with XPO safely. There are many scenarios supporting the use of XPOs, but you need to leave the mindset from pre-AX2012 where anything could be moved using XPO. Either you figure out when XPO can safely be used, or you refrain from using it altogether (like Joris recommends, sort of).

Final note

Moving a precompiled modelstore is only good when the source and targets share the same environment IDs. Production and UAT/Test should use the same IDs, allowing you to have things properly tested before putting it in production, PLUS allowing you to prepare a precompiled ready to launch modelstore having perfectly valid element IDs.

When installing models you need to compile + synchronize. This is a time consuming process and more often you need to keep users out during.

When moving changes using XPO, you need to know how and why it will be ok to move changes using XPO. If you don’t know the how and why, then don’t use XPOs at all.

Thanks Guys

Happy Daxing


Dynamics ax 2012 Id Conflicts

$
0
0

Hi Guys,

Recently i was experiencing the Upgrade and i have faced Id conflicts issue, This blog is about what i have experience and how i am able to rectify and identify the problem.

This content is re-blog of following two posts, through that i got the required info and fixed my issue.

http://dev.goshoom.net/en/2011/11/id-change/

https://yetanotherdynamicsaxblog.wordpress.com/category/sql/

So what is Conflicts ?

If a table ID or field ID is changed in Dynamics AX, data are lost during synchronization, because the table with the old ID (and containing data) is dropped at the beginning and then a new table is created with the same structure but a different ID. The same is valid analogically for table fields.

The data loss can be prevented in several ways (e.g. by data export and re-import), but one solution is really simple and painless. Realize how the situation looks in AX after the ID change (e.g. after installation of a layer with different IDs) but before the database synchronization:

Where Ids are stored in AX ?

You can identify all changed IDs by comparing values in AOT with values in SqlDictionary. And the update of SqlDictionary to the new ID can prevent the regeneration of database objects during synchronization.

ReleaseUpdateDB::changeTableId method is used to updated the SQLDictionary table it takes new and old table id and table name to update the record.

 //Updates table ID in SqlDictionary  
       if (ReleaseUpdateDB::changeTableId(  
         sqlDictionaryTable.tabId,  
         dictTable.id(),  
         dictTable.name()))  
       {  
         info(strFmt("Table ID changed (%1 -> %2)", sqlDictionaryTable.tabId, dictTable.id()));  
       }  

Sometime there is also the need of updating the table id and reflect in the metadata.

There is a Table with name “ModelElement” in AX model database. In this table we have few important fields as, it is important for us to understand these fields.

1. ElementType : this field contains type  ID of data object like for table fields its value will be 42 and for tables it will be 44.

2. AxId : this field contains actual object ID value which create conflicts among environments. We have to change this field value, e-g for AccountNum field of CustTable it could be as 1.

3. ParentId : this field contains parent object ID, like ID of the table, whose field we are looking at, e-g for AccountNum field of CustTable it could be as 77, which is table ID for CustTable.

I have build this query to check the table ids using sql.

 // this query can be used to read the current table id from model db 
 SELECT ELEMENTHANDLE, ROOTHANDLE, NAME, AXID, ORIGIN FROM MODELELEMENT   
 JOIN ELEMENTTYPES ON MODELELEMENT.ELEMENTTYPE = ELEMENTTYPES.ELEMENTTYPE   WHERE NAME IN ('legCustTableLegacy', 'legACCCreditLimitLevelLine', 'legAccountsParameterSetup', 'legAXEnums') AND ELEMENTTYPENAME IN ('TABLE') //This query can update the table id and reflect in meta data. 
 Update M  
 SET m.AxId = 105871  
 FROM MODELELEMENT as M  
 JOIN ELEMENTTYPES ON M.ELEMENTTYPE = ELEMENTTYPES.ELEMENTTYPE  
 WHERE NAME IN ('legACCCreditLimitLevelLine') AND ELEMENTTYPENAME IN ('TABLE')  

Thanks for reading this

Happy Daxing

D365: Set up margin alerts for sales orders

$
0
0
Margin alerts is useful feature that allow you determine price margin and decide whether this item is profitable or not, whether you’d like to add additional discount to the customer and still be afloat...(read more)

RetailTenantUpdateTool.ps1 misses prerequisites

$
0
0
After moving data from one server to another you need to run the RetailTenantUpdateTool powershell script. Doing this might present you with this error: Please download and install below prerequisites...(read more)

Local Business Data for Dynamics 365 Finance and Operations: Microsoft updates guidance as customers weigh options

$
0
0
Microsoft continues to improve the local business data (LBD), or on-premises, deployment model for Dynamics 365 for Finance and Operations (D365FO). And at this week's Summit EMEA 2018 event in Dublin, company officials have explained to the AX ...read more

Microsoft to add new finance, revenue recognition, warehouse tools to Dynamics 365 Finance & Operations in late 2018

$
0
0
Microsoft will be adding new capabilities to Dynamics 365 for Finance and Operations (D365FO) in several areas with its Fall 2018 release wave thanks to new IP deals with partners. The enhancements range from finance and public sector to revenue recognition ...read more

XML response from OData services

$
0
0

If you call OData services in AX 7 (Dynamics 365 for Finance and Operations), you typically get data in JSON format, like this:

{"@odata.context":"https://myaxinstance.cloudax.dynamics.com/data/$metadata","value":[
    {"name":"ElectronicPaymentTypes","kind":"EntitySet","url":"ElectronicPaymentTypes"
    },{"name":"ExpensePaymentDetails","kind":"EntitySet","url":"ExpensePaymentDetails"
    }
    ...
  ]
}

JSON is a simple, lightweight format with good support in many tools, but sometimes you would rather get XML. XML is by no mean deprecated – it’s more than a format; you get a whole platform with capabilities useful for validations (XML schema), querying (XPath, XQuery), transformations (XSLT) and so on. Or you simply have a component that accepts only XML and not JSON.

Fortunately OData services aren’t limited to JSON; they can return XML as well. Simply add HTTP header Accept with value application/atom+xml,application/atomsvc+xml,application/xml and you’ll start getting the same data in XML format:

<ODataServiceDocumentxmlns:i="http://www.w3.org/2001/XMLSchema-instance"xmlns="http://schemas.datacontract.org/2004/07/Microsoft.OData.Core"><EntitySets><ODataEntitySetInfo><Name>ElectronicPaymentTypes</Name><Titlei:nil="true"/><Url>ElectronicPaymentTypes</Url></ODataEntitySetInfo><ODataEntitySetInfo><Name>ExpensePaymentDetails</Name><Titlei:nil="true"/><Url>ExpensePaymentDetails</Url></ODataEntitySetInfo><ODataEntitySetInfo>
  ...
  </EntitySets></ODataServiceDocument>

If you use Postman, for example, this is where you can put the header:

 Of course, that you get XML format doesn’t mean that you get the structure you want. You still may need to transform it to something more suitable for your purposes.

Llegó el Hard Seal a #MSDyn365FO (Abril 2018)… ¿Y ahora qué?

$
0
0
Pues así es, y no creo os pille por sorpresa. Ya lo venían anunciando desde hace tiempo, como podéis ver en la siguiente imagen en la que se muestra el roadmap y las prioridades para las distintas releases...(read more)

Fixed price project calculation methods and their use for IFRS15 / ASC606

$
0
0
This post explains the calculation method functionality that is available for fix price projects and shows how you can make use of the to incorporate the accounting requirements stipulated in IFRS15 /...(read more)

Microsoft UK refreshes its marketing: What the changes mean for partners

$
0
0
It's not often that Microsoft partners get the chance to sit down and discuss the future with senior Microsoft execs, asking them any questions they want. These sessions enable Microsoft partners to understand the thinking, strategy and direction ...read more

From the Microsoft Dynamics 365/AX Blogs: Batch jobs; AX ID conflicts; Troubleshooting D365FFO on-prem; AOS in D365

$
0
0
In this week's Dynamics 365/AX blog roundup: AX 2012 commonly used batch jobs & setup Dynamics AX 2012 ID conflicts Troubleshooting on-premise environment deployment D365FFO AOS: Why have you forbidden me? AX 2012 ...read more

Report a production outage through Lifecycle Services [DynD365FO]

$
0
0
Hi Folks,

As we all aware LCS is a mandate now for any D365FO project with a lot of new changes/update in place. Things are slightly different now for the PROD environment where you don't have any access to servers for PROD all PROD servers are maintained by directly Microsoft.

Here is an update and I believe its an awaited update from most of our customer. Now you can report an outage for production environment straight from LCS, check below post for details;

https://blogs.msdn.microsoft.com/lcs/2017/12/18/report-production-outage-through-lcs/


Enjoy...
-Harry

Follow us on Facebook to keep in rhythm with us. https://fb.com/theaxapta

Microsoft Dynamics 365: Changes to Financial Dimensions Structure

$
0
0
Simplified dimension value fetch After the release of Dynamics 365 for Operations [Enterprise Edition] dimension structure and business logic has slightly changed. In this blog post, I will introduce...(read more)

Dynamics ax 2012 : AxBuild.exe xppcompileall stuck on 3 asterisks

$
0
0

Recently with one of the customer i faced this issue, Each time the compile starts, it just shows the AxBuild prompt with 3 asterisks and the window closes after about 15-20 minutes (without actually doing anything).

Event i have run the command as Admin but nothing worked and faced same problem

axbuild.exe  xppcompileall  /s=01 /altbin=”C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin”

After enough research i came to know that this is possible in two scenarios. The first one is the permissions, ensure the user running axbuild.exe has the same permissions as the AOS Service account and account should have enough access on AX database also. For me this was the problem the account through which i am login to system does not have enough permission to AX database.

AxBuild.exe must be run by an account that has no less security authority than the account that runs the permanent AOS has.

Source: https://msdn.microsoft.com/en-us/library/dn528954.aspx

The second time, it happened when the SQL Server had no more RAM resources available. Then fix would be to clear memory for SQL service.

Thanks for reading

Happy daxing

Amir

 

Trade documents translation in foreign language

$
0
0
Some of the Trading documents are missing the label translations. When you run a report the labels are automatically translated based on user language but for Trade documents it takes more than just translation...(read more)

AX 2012 Call Restful API using basic authentication X++ Dynamics AX 2012

$
0
0

Below code helps you to call the Restful API using basic authentication method of adding Authorization header using HTTP Post method.

 static void ConsumingRestService(Args _args)  
 {  
   str destinationUrl = 'Json Url here', requestXml, responseXml;  
   System.Net.HttpWebRequest    request;  
   System.Net.HttpWebResponse   response;  
   CLRObject            clrObj;  
   System.Byte[]          bytes;  
   System.Text.Encoding      utf8;  
   System.IO.Stream        requestStream, responseStream;  
   System.IO.StreamReader     streamReader;  
   System.Exception        ex;  
   System.Net.WebHeaderCollection httpHeader;  
   str               byteStr;  
   System.Byte[]          byteArray;  
   System.IO.Stream        stream;  
   System.IO.Stream        dataStream;  
   byteStr = strfmt('%1:%2', "USERNAME", "PASSWORD");  
   requestXml = " { \"storeId\": 25001, \"terminalId\":\"012\", \"transactionSequenceNumber\":\"031949640279\", \"lookup\" : { \"nameSearch\" : { \"lastName\" : \"Jones\",\"zipCode\" : \"214034702\" } } }";  
   try  
   {  
     new InteropPermission(InteropKind::ClrInterop).assert();  
     httpHeader = new System.Net.WebHeaderCollection();  
     clrObj = System.Net.WebRequest::Create(destinationUrl);  
     request = clrObj;  
     utf8 = System.Text.Encoding::get_UTF8();  
     bytes = utf8.GetBytes(requestXml);  
     request.set_KeepAlive(true);  
     request.set_ContentType("application/xml");  
     utf8    = System.Text.Encoding::get_UTF8();  
     byteArray  = utf8.GetBytes(byteStr);  
     byteStr   = System.Convert::ToBase64String(byteArray);  
     httpHeader.Add("Authorization", 'Basic ' + byteStr);  
     request.set_ContentType("text/xml; encoding='utf-8'");  
     request.set_ContentLength(bytes.get_Length());  
     request.set_Method("POST");  
     request.set_Headers(httpHeader);  
     requestStream = request.GetRequestStream();  
     requestStream.Write(bytes, 0, bytes.get_Length());  
     response = request.GetResponse();  
     responseStream = response.GetResponseStream();  
     streamReader = new System.IO.StreamReader(responseStream);  
     responseXml = streamReader.ReadToEnd();  
     info(responseXml);  
   }  
   catch (Exception::CLRError)  
   {  
     //bp deviation documented  
     ex = CLRInterop::getLastException().GetBaseException();  
     error(ex.get_Message());  
   }  
   requestStream.Close();  
   streamReader.Close();  
   responseStream.Close();  
   response.Close();  
 }  

Thanks for reading the blog
Happy daxing

Summit EMEA News & Notes, Part 2: Microsoft Dynamics 365 for Customer Experience

$
0
0
In part one of our news and notes from Summit EMEA 2018 , we explored some key updates related to Dynamics 365 for Finance and Operations (D365FO) and related solutions like Talent. In this second part, we turn our attention to a few observations tied ...read more

Summit EMEA News & Notes, Part 1: Microsoft Dynamics 365 for Finance and Operations

$
0
0
Last week's Summit EMEA event in Dublin still catered to two distinct audiences in Dynamics AX and CRM-focused users (including those already on the Dynamics 365 solutions), but content and product updates now trend toward some shared themes: service ...read more

D365Tour newsletter – April 2018

$
0
0
D365Tour Newsletter - April 2018 What's new on MsDyn365Fo for Spring 2018 ? 16'30"...(read more)

Dynamics AX Logical Expression Optimization

$
0
0
Hello AX World, Recently I was reading about Chain of Command (CoC) and found one important statement that I was aware of but have never found in any of the documentation. " Because logical expressions...(read more)
Viewing all 10657 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>