tag:blogger.com,1999:blog-78938072483271722192024-03-14T00:41:11.466-07:00MS ERPs, Dynamics AX, AIF, X++, Sharepoint, Biztalk Server, SRS, .NetMicrosoft Dynamics AX, AIF, X++, MorphX, Sharepoint, SSRS, Biztalk Server, .Net, Integration, Enterprise PortalRajesh Biswashttp://www.blogger.com/profile/07514591087556132461noreply@blogger.comBlogger69125tag:blogger.com,1999:blog-7893807248327172219.post-30564172542722150542016-07-07T07:14:00.000-07:002016-07-07T07:14:52.734-07:00How to export import images or pictures from a table field by X++ code in Microsoft Dynamics AX 2012.<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Verdana, sans-serif;">How to export / import a </span><span style="font-family: Verdana, sans-serif;">picture</span><span style="font-family: Verdana, sans-serif;"> or </span><span style="font-family: Verdana, sans-serif;">image from a table field by X++ code in Microsoft Dynamics AX 2012.</span><br />
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><br /></span>
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><br /></span>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14.85px; line-height: 20.79px;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: red; font-family: Verdana, sans-serif; font-size: 9pt; line-height: 12.84px;">Applied on</span></b><span style="background: white; color: #333333; font-family: Verdana, sans-serif; font-size: 9pt; line-height: 12.84px;">: Dynamics AX 2012 R3 CU9.</span><br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14.85px; line-height: 20.79px;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: red; font-family: Verdana, sans-serif; font-size: 9pt; line-height: 12.84px;">Prerequisite</span></b><span style="background: white; color: #333333; font-family: Verdana, sans-serif; font-size: 9pt; line-height: 12.84px;">: Basic Dynamics AX 2012 programming knowledge.</span><br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14.85px; line-height: 20.79px;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: red; font-family: Verdana, sans-serif; font-size: 9pt; line-height: 12.84px;">Target audience</span></b><span style="background: white; color: #333333; font-family: Verdana, sans-serif; font-size: 9pt; line-height: 12.84px;">: AX programmers.</span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14.85px; line-height: 20.79px;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: red; font-family: Verdana, sans-serif; font-size: 9pt; line-height: 12.84px;">Assumption</span></b><span style="background: white; color: #333333; font-family: Verdana, sans-serif; font-size: 9pt; line-height: 12.84px;">: You are familiar with Dynamics AX 2012.</span><br />
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><br /></span>
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Below X++ job will explain you how to export an image or picture from Dynamics AX 2012 table. It's a simple piece of code but sometimes we spent hours to get the code how to export picture or image. I have posted here just to make it handy.</span><br />
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><br /></span>
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><br /></span>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="color: darkblue; font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;">static</span></b><span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> <b><span style="color: darkblue;">void</span></b>
exportImageFromTable(Args _args)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> bindata bin = <b><span style="color: darkblue;">new</span></b>
bindata();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> <b><span style="color: darkblue;">str</span></b> content;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> <b><span style="color: darkblue;">container</span></b> image;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> RetailImages retailImages;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> FilePath filepath;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> <b><span style="color: darkblue;">select</span></b>
retailImages <b><span style="color: darkblue;">where</span></b>
retailImages.PictureId == <b><span style="color: red;">8045</span></b>;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> filepath = <b><span style="color: darkblue;">strFmt</span></b>(<span style="color: darkred;">'C:\\Users\\Administrator\\AppData\\Local\\Temp\\images\\PictureID_%1.jpg'</span>,
retailImages.PictureId);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> image = retailImages.picture;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> bin.setData(image);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> <i><span style="color: green;">// Create the
base64 encoded string</span></i><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> <i><span style="color: green;">// content =
bin.base64Encode();</span></i><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> <i><span style="color: green;">//
info(content);</span></i><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> <i><span style="color: green;">// Save it to
the file system as a jpg, png or tif format</span></i><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> AifUtil::saveBase64ToFile(@filepath,
content);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> <o:p></o:p></span></div>
<span style="font-family: Consolas; font-size: 8.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-bidi-font-family: Consolas; mso-bidi-language: AR-SA; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin;">}</span><br />
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><br /></span>
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><br /></span>
<span style="font-family: Verdana, sans-serif;">In addition I am share the code how to import or insert a picture or image in Dynamics AX 2012 using X++ code.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Here is the job:</span><br />
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><br /></span>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="color: darkblue; font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;">static</span></b><span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> <b><span style="color: darkblue;">void</span></b>
InsertImageToTableField(Args _args)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> Bindata binData = <b><span style="color: darkblue;">new</span></b>
BinData();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> FilePath path;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> RetailImages retailImages;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> <b><span style="color: darkblue;">str</span></b> imageID;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> path = <span style="color: darkred;">"C:\\Users\\Administrator\\AppData\\Local\\Temp\\Images\\PictureID_8046.jpg"</span>;
<i><span style="color: green;">// file location</span></i><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> binData.loadFile(path);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> <b><span style="color: darkblue;">select</span></b>
retailImages <b><span style="color: darkblue;">where</span></b>
retailImages.PictureId == <b><span style="color: red;">1111</span></b>;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> <b><span style="color: darkblue;">if</span></b>
(!retailImages)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> {<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> retailImages.picture = binData.getData();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> retailImages.PictureId = <b><span style="color: red;">1111</span></b>;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> retailImages.doInsert();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> <o:p></o:p></span></div>
<span style="font-family: Consolas; font-size: 8.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-bidi-font-family: Consolas; mso-bidi-language: AR-SA; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin;">}</span><br />
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><br /></span>
<br />
<span style="font-family: Verdana, sans-serif;">Hope this was useful. You may leave your comment below.</span><br />
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><br /></span>
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><br /></span>
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><br /></span>
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><br /></span>
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><br /></span></div>
Rajesh Biswashttp://www.blogger.com/profile/07514591087556132461noreply@blogger.com15tag:blogger.com,1999:blog-7893807248327172219.post-15713207969133702722016-06-20T08:36:00.000-07:002016-06-20T08:36:07.243-07:00How to export data in a csv or comma separated file by X++ code in Microsoft Dynamics AX 2012<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div style="margin: 0in 0in 8pt;">
<span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">In Microsoft Dynamics AX 2012 how to export data in a csv
or comma separated file by X++ code.</span></div>
<br />
<div style="margin: 0in 0in 8pt;">
<span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">This article explains how to generate a csv or comma
separated file and export data from Microsoft Dynamics AX 2012 by X++ code.</span></div>
<br />
<div style="margin: 0in 0in 8pt;">
<br /></div>
<br />
<div style="margin: 0in 0in 8pt;">
<b><span style="background: white; color: red; font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%; mso-bidi-font-family: Arial;">Applied
on</span></b><span style="background: white; color: #333333; font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">: Dynamics AX 2012 R3 CU9.<br />
</span><b><span style="background: white; color: red; font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">Prerequisite</span></b><span style="background: white; color: #333333; font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">: Basic Dynamics AX 2012 programming knowledge.<br />
</span><b><span style="background: white; color: red; font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">Target audience</span></b><span style="background: white; color: #333333; font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">: AX programmers.<br />
</span><b><span style="background: white; color: red; font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">Assumption</span></b><span style="background: white; color: #333333; font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">: You are familiar with Dynamics AX 2012.</span></div>
<br />
<div style="margin: 0in 0in 8pt;">
<br /></div>
<br />
<div style="margin: 0in 0in 8pt;">
<span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">I prepared a x++ job here which will guide you how to
generate a csv file with a header and one sample line. If you have one header and multi line, you may keep line in a while.</span></div>
<br />
<div style="margin: 0in 0in 8pt;">
<br /></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<b><span style="color: darkblue; font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;">static</span></b><span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"> <b><span style="color: darkblue;">void</span></b>
exportDataInCSV(Args _args)</span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;">{</span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span>Dialog<span style="mso-spacerun: yes;"> </span>dialog<span style="mso-spacerun: yes;"> </span>= <b><span style="color: darkblue;">new</span></b>
Dialog();</span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span>DialogField<span style="mso-spacerun: yes;"> </span>dialogFieldFileSave;</span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span>Commaio<span style="mso-spacerun: yes;"> </span>file;</span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">container</span></b><span style="mso-spacerun: yes;"> </span>line;</span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span>FilePath<span style="mso-spacerun: yes;"> </span>TempPath;</span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<br /></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span>dialogFieldFileSave<span style="mso-spacerun: yes;"> </span>= dialog.addField(<b><span style="color: darkblue;">extendedTypeStr</span></b>(FilenameSave),<span style="color: darkred;">"File path"</span>,<span style="color: darkred;">"Help
text goes here"</span>);</span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span>dialog.caption(<span style="color: darkred;">"Caption
goes here"</span>);</span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span>dialog.filenameLookupFilter([<span style="color: darkred;">'csv'</span>,<span style="color: darkred;">'*.csv'</span>]);</span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<br /></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">if</span></b>(!dialog.run())</span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">return</span></b>;</span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<br /></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">if</span></b>
(dialogFieldFileSave.value() == <span style="color: darkred;">''</span>)</span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span>{</span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span>error(<span style="color: darkred;">"Please
set up the location for export file."</span>);</span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">return</span></b>;</span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span>}</span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<br /></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span>TempPath = dialogFieldFileSave.value() + <span style="color: darkred;">'.csv'</span>;</span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<br /></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span>#define.filename(TempPath)</span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span>#File</span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<br /></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<br /></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span>file = <b><span style="color: darkblue;">new</span></b>
Commaio(#filename , #io_write);</span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">if</span></b>(
!file || file.status() != IO_Status::Ok)</span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span>{</span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">throw</span></b>
error(<span style="color: darkred;">"File Cannot be opened"</span>);</span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span>}</span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<br /></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span><i><span style="color: green;">//Put headers</span></i></span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span>line = [<span style="color: darkred;">"CardNum"</span>,<span style="color: darkred;">"Amount"</span>,<span style="color: darkred;">"IssueDate"</span>,<span style="color: darkred;">"ExpiryDate"</span>,<span style="color: darkred;">"IssueBy"</span>,<span style="color: darkred;">"CustAccount"</span>,<span style="color: darkred;">"Description"</span>];</span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span>file.writeExp(line);</span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<br /></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span><i><span style="color: green;">//Put a sample
line</span></i></span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span>line = [<span style="color: darkred;">"C_476786"</span>,<span style="color: darkred;">"100.00"</span>,<span style="color: darkred;">"05/26/2015"</span>,<span style="color: darkred;">"03/25/2016"</span>,<span style="color: darkred;">"John
Smith S"</span>,<span style="color: darkred;">"Cust_0000034"</span>,<span style="color: darkred;">"Description"</span>];</span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span>file.writeExp(line);</span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<br /></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span>info(<b><span style="color: darkblue;">strFmt</span></b>(<span style="color: darkred;">"File exported successfully. Please find it at
%1"</span>,TempPath));</span></div>
<br />
<div style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Consolas;">}</span></div>
<br />
<div style="margin: 0in 0in 8pt;">
<br /></div>
<br />
<div style="margin: 0in 0in 8pt;">
<br /></div>
<br />
<div style="margin: 0in 0in 8pt;">
<span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">Hope this was useful. You may leave your comment below.</span></div>
<br />
<div style="margin: 0in 0in 8pt;">
<br /></div>
<br />
<div style="margin: 0in 0in 8pt;">
<br /></div>
<br />
<div style="margin: 0in 0in 8pt;">
<br /></div>
<br />
<div style="margin: 0in 0in 8pt;">
<br /></div>
<b></b><i></i><u></u><sub></sub><sup></sup><strike></strike></div>
Rajesh Biswashttp://www.blogger.com/profile/07514591087556132461noreply@blogger.com2tag:blogger.com,1999:blog-7893807248327172219.post-21246794695381440062016-06-16T14:50:00.001-07:002016-06-16T14:50:51.819-07:00In Microsoft Dynamics AX 2012 how to update a division, department, location cost center as financial dimension by X++ code.<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal">
<span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">In Microsoft Dynamics AX 2012 how to update a financial
dimension field by X++ code.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">In Microsoft Dynamics AX 2012 how to update a division,
department, location cost center as financial dimension by X++ code.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b><span style="background: white; color: red; font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%; mso-bidi-font-family: Arial;">Applied
on</span></b><span style="background: white; color: #333333; font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">: Dynamics AX 2012 R3 CU8.<br />
<b><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: red; font-size: 9pt; line-height: 107%;">Prerequisite</span></span></span></b><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-size: 9pt; line-height: 107%;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;">: Basic Dynamics AX 2012 programming knowledge.<br />
</span><b><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: red; font-size: 9pt; line-height: 107%;">Target audience</span></b></span></span><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-size: 9pt; line-height: 107%;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;">: AX programmers.<br />
</span><b><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: red; font-size: 9pt; line-height: 107%;">Assumption</span></b></span></span><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-size: 9pt; line-height: 107%;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;">: You are familiar with Dynamics AX 2012.</span><o:p></o:p></span></span></span></div>
<div class="MsoNormal">
<span style="background: white; color: #333333; font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-size: 9pt; line-height: 107%;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><br /></span></span></span></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">There was a requirement from one of the functional
analyst to update the 3<sup>rd</sup> Financial Dimension only. When functional
analyst loaded products to Dynamics AX this financial dimension was missing for
every product. It was about 90 thousand products. Because of huge number of products,
it was possible for him to do it manually. I wrote a X++ job to update it.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwTpqlspvimWv72RO-EI_tXFdpR_j7csZFVTO25QGncfZN9JOv8SPip-XrZBCoefZIuV6X8ybdLpV2i2u76zEo9pUe68-EToNUADqgup_aD8bK4ukB86Ygg7Q3pVsxfZK4hFcq1D-eeNJ7/s1600/updateDim1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwTpqlspvimWv72RO-EI_tXFdpR_j7csZFVTO25QGncfZN9JOv8SPip-XrZBCoefZIuV6X8ybdLpV2i2u76zEo9pUe68-EToNUADqgup_aD8bK4ukB86Ygg7Q3pVsxfZK4hFcq1D-eeNJ7/s400/updateDim1.png" width="295" /></a></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">Here is the X++ job.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="color: darkblue; font-family: Consolas; font-size: 8.0pt;">static</span></b><span style="font-family: Consolas; font-size: 8.0pt;"> <b><span style="color: darkblue;">void</span></b>
updateFinancialDimension(Args _args)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
Struct struct = <b><span style="color: darkblue;">new</span></b> Struct();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> <b><span style="color: darkblue;">container</span></b> financialDimension;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
DimensionDefault
dimensionDefault;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
InventTable
inventTable;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
InventItemGroupItem
inventItemGroupItem;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> <b><span style="color: darkblue;">ttsBegin</span></b>;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> <b><span style="color: darkblue;">select</span></b> <b><span style="color: darkblue;">forUpdate</span></b>
inventtable<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> <b><span style="color: darkblue;">where</span></b> inventTable.dataAreaId == <span style="color: darkred;">'your data area id'</span> && inventTable.ItemId
== <span style="color: darkred;">'Test'</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
struct.add(<span style="color: darkred;">'Division'</span>, <span style="color: darkred;">'048'</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
financialDimension += struct.fields();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
financialDimension += struct.fieldName(<b><span style="color: red;">1</span></b>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
financialDimension += struct.valueIndex(<b><span style="color: red;">1</span></b>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
dimensionDefault =
AxdDimensionUtil::getDimensionAttributeValueSetId(financialDimension);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> <b><span style="color: darkblue;">if</span></b> (inventTable.RecId)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> {<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
inventTable.DefaultDimension = DimensionDefault;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
inventTable.update();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> <i><span style="color: green;">//info(inventTable.ItemId);</span></i><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> <b><span style="color: darkblue;">ttsCommit</span></b>;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">}<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">After executing the above job I got below result.<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCgL282zmVEH2qMO3sovEIPs7mZt-RHsg4yREB68DHe0jC_keB49trWba6gadxsQAqAKvXxj5xiqX7sZOFepGHmAWIA4Pk7PqSDzxtmYTqqQ9eS8kIJsXsRN9tajZTXTuNhMZqZ_QtWiAO/s1600/updateDim2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="390" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCgL282zmVEH2qMO3sovEIPs7mZt-RHsg4yREB68DHe0jC_keB49trWba6gadxsQAqAKvXxj5xiqX7sZOFepGHmAWIA4Pk7PqSDzxtmYTqqQ9eS8kIJsXsRN9tajZTXTuNhMZqZ_QtWiAO/s400/updateDim2.png" width="400" /></a></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">Now question is if you need to do it for all the 4
dimensions how to do?<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">Here I have another X++ job to do it for all the
financial dimension fields update. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="color: darkblue; font-family: Consolas; font-size: 8.0pt;">static</span></b><span style="font-family: Consolas; font-size: 8.0pt;"> <b><span style="color: darkblue;">void</span></b>
updateAllFinancialDimension(Args _args)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
Struct struct = <b><span style="color: darkblue;">new</span></b>
Struct();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> <b><span style="color: darkblue;">container</span></b> ledgerDimension;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
DimensionDefault
dimensionDefault;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
InventTable
inventTable;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
InventItemGroupItem
inventItemGroupItem;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> <b><span style="color: darkblue;">ttsBegin</span></b>;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> <i><span style="color: green;">//while select forUpdate inventtable<o:p></o:p></span></i></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<i><span style="color: green; font-family: Consolas; font-size: 8.0pt;"> //
where inventTable.dataAreaId == 'your data area id' &&
inventTable.ItemId == 'Test'</span></i><span style="font-family: Consolas; font-size: 8.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> <b><span style="color: darkblue;">select</span></b> <b><span style="color: darkblue;">forUpdate</span></b>
inventtable<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> <b><span style="color: darkblue;">where</span></b> inventTable.dataAreaId == <span style="color: darkred;">'your data area id'</span> && inventTable.ItemId
== <span style="color: darkred;">'Test'</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> struct.add(<span style="color: darkred;">'BusinessUnit'</span>, <span style="color: darkred;">'001'</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
struct.add(<span style="color: darkred;">'CostCenter'</span>, <span style="color: darkred;">'002'</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
struct.add(<span style="color: darkred;">'Division'</span>, <span style="color: darkred;">'033'</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
struct.add(<span style="color: darkred;">'Location'</span>, <span style="color: darkred;">'0475486'</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
ledgerDimension += struct.fields();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
ledgerDimension += struct.fieldName(<b><span style="color: red;">1</span></b>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
ledgerDimension += struct.valueIndex(<b><span style="color: red;">1</span></b>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
ledgerDimension += struct.fieldName(<b><span style="color: red;">2</span></b>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
ledgerDimension += struct.valueIndex(<b><span style="color: red;">2</span></b>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
ledgerDimension += struct.fieldName(<b><span style="color: red;">3</span></b>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
ledgerDimension += struct.valueIndex(<b><span style="color: red;">3</span></b>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
ledgerDimension += struct.fieldName(<b><span style="color: red;">4</span></b>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
ledgerDimension += struct.valueIndex(<b><span style="color: red;">4</span></b>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
dimensionDefault =
AxdDimensionUtil::getDimensionAttributeValueSetId(ledgerDimension);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> <b><span style="color: darkblue;">if</span></b> (inventTable.RecId)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> {<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
inventTable.DefaultDimension = dimensionDefault;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
inventTable.update();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> <i><span style="color: green;">//info(inventTable.ItemId);</span></i><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> <b><span style="color: darkblue;">ttsCommit</span></b>;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">}<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<br />
<div class="MsoNormal">
<span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">Hope this was useful. You may leave your comment below.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
</div>
Rajesh Biswashttp://www.blogger.com/profile/07514591087556132461noreply@blogger.com1tag:blogger.com,1999:blog-7893807248327172219.post-44877182239760377082016-06-16T12:27:00.000-07:002016-06-16T12:27:58.365-07:00In Microsoft Dynamics AX 2012 how to get a progress bar to display the progress of a process or transaction by X++ code.<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;">In Microsoft Dynamics AX 2012 how to get a progress bar
to display the progress of a process or transaction by X++ code.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b><span style="background: white; color: red; font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;">Applied
on</span></b><span style="background: white; color: #333333; font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;">: Dynamics AX 2012 R3 CU8.<br />
<b><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="color: red; font-size: 9pt; line-height: 107%;">Prerequisite</span></span></span></b><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-size: 9pt; line-height: 107%;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;">: Basic Dynamics AX 2012 programming knowledge.<br />
</span><b><span style="color: red; font-size: 9pt; line-height: 107%;">Target audience</span></b></span></span><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-size: 9pt; line-height: 107%;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;">: AX programmers.<br />
</span><b><span style="color: red; font-size: 9pt; line-height: 107%;">Assumption</span></b></span></span><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-size: 9pt; line-height: 107%;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;">: You are familiar with Dynamics AX 2012.</span><o:p></o:p></span></span></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;">There are different ways to get a progress bar or update
bar while a lengthy transaction or update is happening.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;">It’s always nice to give a progress bar to user for any
lengthy manual operation so that gives user an indication like something is
happening.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;">Below method is responsible to give a progress bar if you
use it for any heavy or lengthy operation.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<b><span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;">Option
1:</span><o:p></o:p></b></div>
<div class="MsoNormal">
<b><span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></b></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="color: darkblue; font-family: "consolas"; font-size: 8.0pt;">public</span></b><span style="font-family: "consolas"; font-size: 8.0pt;"> <b><span style="color: darkblue;">static</span></b>
<b><span style="color: darkblue;">client</span></b> SysOperationProgress
showWaitDialog(<b><span style="color: darkblue;">str</span></b> _text = <span style="color: darkred;">"Extracting record for you, please wait..."</span>)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "consolas"; font-size: 8.0pt;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "consolas"; font-size: 8.0pt;"> #AviFiles<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "consolas"; font-size: 8.0pt;">
SysOperationProgress waitDialog;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "consolas"; font-size: 8.0pt;">
waitDialog = <b><span style="color: darkblue;">new</span></b>
SysOperationProgress(<b><span style="color: red;">1</span></b>, <b><span style="color: darkblue;">true</span></b>, <b><span style="color: darkblue;">strLen</span></b>(_text));<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "consolas"; font-size: 8.0pt;">
waitDialog.setCaption(<span style="color: darkred;">"Calculating
value..."</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "consolas"; font-size: 8.0pt;">
waitDialog.setTotal(<b><span style="color: red;">100</span></b>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "consolas"; font-size: 8.0pt;">
waitDialog.setCount(<b><span style="color: red;">1</span></b>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "consolas"; font-size: 8.0pt;">
waitDialog.setAnimation(#AviUpdate);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "consolas"; font-size: 8.0pt;">
waitDialog.setText(_text);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "consolas"; font-size: 8.0pt;"> <b><span style="color: darkblue;">return</span></b> waitDialog;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "consolas"; font-size: 8.0pt;">}<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;">The output is shown below.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiO6D_-rmt7NWSUqy_NNpqkiIHdT9UOpuKj8PW92De3QMAEB069imdCpmQPHTYQYbkM2LYq5sX8gwW0Mw3ImevlpwGMc-NBsbvlhVN0Wui99etDhcLJW_INizaHM-eBG33MuZsXoZ0UFJ8r/s1600/ProgressBar1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="78" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiO6D_-rmt7NWSUqy_NNpqkiIHdT9UOpuKj8PW92De3QMAEB069imdCpmQPHTYQYbkM2LYq5sX8gwW0Mw3ImevlpwGMc-NBsbvlhVN0Wui99etDhcLJW_INizaHM-eBG33MuZsXoZ0UFJ8r/s400/ProgressBar1.png" width="400" /></a></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;">To get the above shown output you need to create a method
as shown above and call the method before your lengthy operation starts.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;">How to call?<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;">I have a sample job here to call the method.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_VEFaW0VL563o06WbcFk9D0Ci4L3Hl2paa1WukHVrJ53A77aOPXLyAOm-hszFIwbq9TgDAsASSV4AiPnJEcRGgPNrlXoj8Jcea-TrDz-cgDrRgvoSkOPj_Yye0KZ-qhEX9wJvU0hAZk5Y/s1600/ProgressBar2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="228" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_VEFaW0VL563o06WbcFk9D0Ci4L3Hl2paa1WukHVrJ53A77aOPXLyAOm-hszFIwbq9TgDAsASSV4AiPnJEcRGgPNrlXoj8Jcea-TrDz-cgDrRgvoSkOPj_Yye0KZ-qhEX9wJvU0hAZk5Y/s400/ProgressBar2.png" width="400" /></a></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><b><br /></b></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><b>Option 2:</b><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><b><br /></b></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;">Add startLengthyOperation() before and after your lengthy
operation code. A sample code is shown below with output. In this case you see
a busy icon and system does not allow to do anything.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcs_wrWTxHvG2bXCFpwfZfn6B1SgsDXoeRGzapcCCUyGGgqMbIoigXGoZnb3FL5yhLa39P301c_nsd5pqXETnH_bABorjQwYHIi6hPN5ratnL5Fiwz2jGX91q4ez5sbvbj2sJidkF9AqQl/s1600/ProgressBar3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="137" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcs_wrWTxHvG2bXCFpwfZfn6B1SgsDXoeRGzapcCCUyGGgqMbIoigXGoZnb3FL5yhLa39P301c_nsd5pqXETnH_bABorjQwYHIi6hPN5ratnL5Fiwz2jGX91q4ez5sbvbj2sJidkF9AqQl/s400/ProgressBar3.png" width="400" /></a></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
</div>
Rajesh Biswashttp://www.blogger.com/profile/07514591087556132461noreply@blogger.com2tag:blogger.com,1999:blog-7893807248327172219.post-31762989771365798862016-06-15T10:28:00.000-07:002016-06-15T10:28:34.738-07:00In Microsoft dynamics AX 2012 (RTM, R2 or R3) how to get the financial dimension structure along with ledger account or any other account by X++ code?<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal">
<span style="background: white; color: #333333; font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">From this article you may
get answer of below questions.<o:p></o:p></span></div>
<div class="MsoNormal">
</div>
<ul style="text-align: left;">
<li><span style="background-color: white; color: #333333; font-family: Verdana, sans-serif; font-size: 9pt; line-height: 107%;">In Microsoft dynamics AX
2012 (RTM, R2 or R3) how to get the financial dimension structure by X++ code?</span></li>
<li><span style="background-color: white; color: #333333; font-family: Verdana, sans-serif; font-size: 9pt; line-height: 107%;">In Microsoft dynamics AX
2012 (RTM, R2 or R3) how to get the dimension structure along with main account
by X++ code?</span></li>
<li><span style="background-color: white; color: #333333; font-family: Verdana, sans-serif; font-size: 9pt; line-height: 107%;">In Microsoft dynamics AX
2012 (RTM, R2 or R3) how to get the financial dimension structure along with
ledger account, bank account, customer account or any other account by X++ code?</span></li>
<li><span style="background-color: white; color: #333333; font-family: Verdana, sans-serif; font-size: 9pt; line-height: 107%;">In Microsoft dynamics AX
2012 (RTM, R2 or R3) different ways to get the financial dimension structure by
X++ code?</span></li>
<li><span style="background-color: white; color: #333333; font-family: Verdana, sans-serif; font-size: 9pt; line-height: 107%;">In Microsoft dynamics AX
2012 (RTM, R2 or R3) how to get financial dimension attribute and its value by
X++ code?</span></li>
</ul>
<br />
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b><span style="background: white; color: red; font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%; mso-bidi-font-family: Arial;">Applied
on</span></b><span style="background: white; color: #333333; font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">: Dynamics AX 2012 R3 CU8.<br />
<b><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: red; font-size: 9pt; line-height: 107%;">Prerequisite</span></span></b><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-size: 9pt; line-height: 107%;">: Basic Dynamics AX 2012 programming knowledge.<br />
</span><b><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: red; font-size: 9pt; line-height: 107%;">Target audience</span></b></span><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-size: 9pt; line-height: 107%;">: AX
programmers.<br />
</span><b><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: red; font-size: 9pt; line-height: 107%;">Assumption</span></b></span><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-size: 9pt; line-height: 107%;">: You are familiar with Dynamics AX 2012.</span></span></span><o:p></o:p></div>
<div class="MsoNormal">
<span style="background: white; color: #333333; font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-size: 9pt; line-height: 107%;"><br /></span></span></span></div>
<div class="MsoNormal">
<span style="background: white; color: #333333; font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-size: 9pt; line-height: 107%;"><br /></span></span></span></div>
<div class="MsoNormal">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAAhyphenhyphenSFwaeaOshZr8XTVbfQAjKZ_YowUmsHWOMJTeAHMwRuxdnKjUa1ANcF-JfMA6OJYRu_fehJaCYnZa6JdjqOV1kD7_SyWCYR6fIKFV8OkgyHs6P_ni8e2YGkNG8YcL-AJ4NEhf4POK1/s1600/DimensionStructure1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAAhyphenhyphenSFwaeaOshZr8XTVbfQAjKZ_YowUmsHWOMJTeAHMwRuxdnKjUa1ANcF-JfMA6OJYRu_fehJaCYnZa6JdjqOV1kD7_SyWCYR6fIKFV8OkgyHs6P_ni8e2YGkNG8YcL-AJ4NEhf4POK1/s1600/DimensionStructure1.png" /></a></div>
<br /><div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="background: white; color: #333333; font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">Please see the above
image, it’s a financial dimension on sales order, in general such kind of field
holds a RecId if you see it at table level. Question is how to get all these
dimensions and their values by X++ code? <o:p></o:p></span></div>
<div class="MsoNormal">
<span style="background: white; color: #333333; font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">You may have faced the requirement
where you need to bring the dimension structure along with an account. E.g. a
ledger account should be flown along with the default or financial dimension
structure. Let’s say ledger account number 3235 and above shown financial
dimension should be added and final outcome should be like
3235-001-100-047-00001. How to get this ledger account along with structure by
x++ code?<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="background: white; color: #333333; font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">There are two ways to get
this done.<o:p></o:p></span></div>
<div class="MsoNormal">
<b><span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></b></div>
<div class="MsoNormal">
<b><span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">Option
1:<o:p></o:p></span></b></div>
<div class="MsoNormal">
<span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">In below example I need to assign offset ledger dimension
to ledgerJournalTrans table field along with financial dimension from
SalesTable. When you need to create payment journal and voucher by X++ code, it
could be a perfect requirement match for you.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">LedgerJournalTrans.OffsetLedgerDimension =
DimensionDefaultingService::serviceCreateLedgerDimension(<span style="color: red;">5637189003</span>,SalesTable.DefaultDimension);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">Here </span>serviceCreateLedgerDimension() <span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">is a
method of DimensionDefaultingService class which gives you a RecId with
structure combination. To this method I’m passing two parameters, 1st one is a
ledger Account coming from Account Receivable parameter which is account number
10140 and 2nd one is coming from SalesTable.DefaultDimension field. This is
according to my requirement. In my case I should get the outcome like
10140--001-100-047-00001 as return value from</span> <span style="font-family: Consolas; font-size: 8.0pt; line-height: 107%;">serviceCreateLedgerDimension()</span>
<span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">method
which again nothing a RecId only and on left hand</span> side <span style="font-family: Consolas; font-size: 8.0pt; line-height: 107%;">LedgerJournalTrans.OffsetLedgerDimension</span>
<span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">field
is expecting a RecId.</span><o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgN8RpOePoxeQZTFxADWFnolLGXzZiJIUSa7OYy9TKFzk3gy3lBibxGbu9bmaovXId5yUptSr2gSKOkqDGhcFz2cPph-lqCNP1aNknMxh_WAew9QQoCNphl-LoS0Cvc9wDItJsPM1zxZ_sd/s1600/DimensionStructure2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="246" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgN8RpOePoxeQZTFxADWFnolLGXzZiJIUSa7OYy9TKFzk3gy3lBibxGbu9bmaovXId5yUptSr2gSKOkqDGhcFz2cPph-lqCNP1aNknMxh_WAew9QQoCNphl-LoS0Cvc9wDItJsPM1zxZ_sd/s400/DimensionStructure2.png" width="400" /></a></div>
<br /><div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b><span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">Option
2:<o:p></o:p></span></b></div>
<div class="MsoNormal">
<span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">In below example I need to assign offset ledger dimension
to ledgerJournalTrans table field along with financial dimension from
SalesTable.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<i><span style="color: green; font-family: Consolas; font-size: 8.0pt;">//acctPattern =
['10140','10140',4,'BusinessUnit','001','CostCenter','100','Division','047','Location','00001'];<o:p></o:p></span></i></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">LedgerJournalTrans.OffsetLedgerDimension = AxdDimensionUtil::getLedgerAccountId(acctPattern);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">Here I’m giving a parm to getLedgerAccontId() which is
nothing a container type variable called acctPattern. What this container type
variable contains? To get the answer you may refer above commended line. The 1<sup>st</sup>
two values of this container are main account display value and main account
number or ledger account, 3<sup>rd</sup> value is number of dimension. I have 4
dimensions here. The 4<sup>th</sup> and 5<sup>th</sup> values are dimension
Business unit and its value 001. The 6<sup>th</sup> and 7<sup>th</sup> values
are dimension Cost center and its value 100. The 8<sup>th</sup> and 9<sup>th</sup>
values are dimension Division and its value 047. The 10<sup>th</sup> and 11<sup>th</sup>
values are dimension Location and its value 00001.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">I know you must be thinking why to pass hard coded values
to container type variable?<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">By using X++ code you can make it dynamic.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;">Below code you may use as an example to get container type return. You can create a method at tale or class level.</span><o:p></o:p></div>
<div class="MsoNormal">
<span style="font-family: "Verdana",sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="color: darkblue; font-family: Consolas; font-size: 8.0pt;">public</span></b><span style="font-family: Consolas; font-size: 8.0pt;"> <b><span style="color: darkblue;">container</span></b>
getDimensionPattern(DimensionDisplayValue _displayValue, LedgerJournalAC
_accountNum, DimensionDynamicDefaultAccount _defaultDimension)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> <b><span style="color: darkblue;">container</span></b> conAcctStructure;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
RetailMCRChannelTable
RetailMCRChannelTable;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
DimensionAttributeValueSet
dimAttrValueSet;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
DimensionAttributeValueSetItem
dimAttrValueSetItem;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
DimensionAttributeValue
dimAttrValue;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
DimensionAttribute
dimAttr;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
conAcctStructure += _displayValue;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
conAcctStructure += _accountNum;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
conAcctStructure += <b><span style="color: red;">4</span></b>; <i><span style="color: green;">//4
Dimensions</span></i><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
dimAttrValueSet = DimensionAttributeValueSet::find(_defaultDimension);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> <b><span style="color: darkblue;">while</span></b> <b><span style="color: darkblue;">select</span></b>
dimAttrValueSetItem<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> <b><span style="color: darkblue;">where</span></b>
dimAttrValueSetItem.DimensionAttributeValueSet == dimAttrValueSet.RecId<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> {<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
dimAttrValue =
DimensionAttributeValue::find(dimAttrValueSetItem.DimensionAttributeValue);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> dimAttr =
DimensionAttribute::find(dimAttrValue.DimensionAttribute);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
conAcctStructure += dimAttr.Name;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">
conAcctStructure += dimAttrValue.getValue();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"> <b><span style="color: darkblue;">return</span></b> conAcctStructure;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;">}<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 8.0pt;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Calibri, sans-serif; font-size: 14.6667px; line-height: 15.6933px;">Below screenshot was taken while I was debugging the above method.</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZF40jBGaGIGOhjQku6uzxyl5spl7AzdRUqu6OoHmYVcpOi-kY1Rxos5EPUiuNtUOzQemjB0PkYbR7ZiZYaW1s4DDnNvpjVrhaiI2xcdHKfnwY5e0tTe7fSjBgv-Q47T1GXf4eXcuqdlUm/s1600/DimensionStructure3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="198" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZF40jBGaGIGOhjQku6uzxyl5spl7AzdRUqu6OoHmYVcpOi-kY1Rxos5EPUiuNtUOzQemjB0PkYbR7ZiZYaW1s4DDnNvpjVrhaiI2xcdHKfnwY5e0tTe7fSjBgv-Q47T1GXf4eXcuqdlUm/s320/DimensionStructure3.png" width="320" /></a></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<span style="font-family: "Calibri",sans-serif; font-size: 11.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">Hope this was useful. You may leave your comment
or feedback below.</span></div>
Rajesh Biswashttp://www.blogger.com/profile/07514591087556132461noreply@blogger.com1tag:blogger.com,1999:blog-7893807248327172219.post-6477659495637723302016-06-07T08:29:00.000-07:002016-06-15T10:48:27.126-07:00How to get postal address for customer or vendor by address type in Microsoft Dynamics AX 2012<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt;">This
article explains how to get postal address for customer or vendor by address type
in Microsoft Dynamics AX 2012 using X++ code.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="background: white; color: red; font-family: "verdana" , sans-serif; font-size: 9.0pt;">Applied on</span></b><span style="background: white; color: #333333; font-family: "verdana" , sans-serif; font-size: 9.0pt;">: Dynamics AX 2012 R3 CU8.<br />
<b><span style="color: red; font-size: 9pt;">Prerequisite</span></b><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-size: 9pt;">: Basic
Dynamics AX 2012 programming knowledge.<br />
</span><b><span style="color: red; font-size: 9pt;">Target audience</span></b><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-size: 9pt;">: AX
programmers.<br />
</span><b><span style="color: red; font-size: 9pt;">Assumption</span></b><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-size: 9pt;">: You are
familiar with Dynamics AX 2012.</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt;">Couple of
times I received queries from my coworkers that how to get customer address or
vendor address by type using standard code.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt;">I noticed
few of my coworkers used to write custom code to get postal address for
customer or vendor and they struggled to find table(s) to be included in the
query. It's time consuming.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt;">In
Microsoft Dynamics AX 2012 we have standard class which you can use to get address
without writing any custom code.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt;">E.g.
Class DirParty has couple of useful methods for different purpose like
getPostalAddress() to get the postal address, getPostalAddressByType() to get
the postal address by address type etc.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;">The method getPostalAddressByType() gives you a complete address based
on party and address type. Here you need to make a note that this method gives the
address in a single string. If you need entire address information by field values,
you can copy this method and write a new method where you can return the table
LogisticsPostalAddress instead of Addressing EDT. Below code image you can
refer to make required change. The highlighted code in red color should be removed
and green color code you need to add at first and last line as shown in the
image.</span><br />
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDb3hSWkWgET4rReiA3QFlv2-OHVyyzPwCVbtSneLbyZaAzPo6iA0q5KCZBNNVyZEe2zH1JKfourDCy81ZxYJkSCSdKpwqbcwfql9vhr8VyUbeNwr8Hn1Fxtk5CP6lqh2KBs0ZMN82w0_S/s1600/PostalAddressByType.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="346" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDb3hSWkWgET4rReiA3QFlv2-OHVyyzPwCVbtSneLbyZaAzPo6iA0q5KCZBNNVyZEe2zH1JKfourDCy81ZxYJkSCSdKpwqbcwfql9vhr8VyUbeNwr8Hn1Fxtk5CP6lqh2KBs0ZMN82w0_S/s400/PostalAddressByType.png" width="400" /></a></div>
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
Rajesh Biswashttp://www.blogger.com/profile/07514591087556132461noreply@blogger.com2tag:blogger.com,1999:blog-7893807248327172219.post-86119062696318034542016-05-26T11:58:00.005-07:002016-05-26T12:00:31.236-07:00In Microsoft Dynamics AX 2012 how to get account lookup based on Ledger Account type, Bank Account type, Customer Account type, Vendor Account type etc.<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt;">This
article explains about:<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpFirst" style="margin-bottom: 0.0001pt; text-indent: -0.25in;">
<!--[if !supportLists]--><span style="font-family: "symbol"; font-size: 9.0pt;">·<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]--><span style="font-family: "verdana" , sans-serif; font-size: 9.0pt;">In
Microsoft Dynamics AX 2012 how to get account lookup based on account type.<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpLast" style="margin-bottom: 0.0001pt; text-indent: -0.25in;">
<!--[if !supportLists]--><span style="font-family: "symbol"; font-size: 9.0pt;">·<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]--><span style="font-family: "verdana" , sans-serif; font-size: 9.0pt;">In
Microsoft Dynamics AX 2012 how to get account lookup based on Ledger Account
type, Bank Account type, Customer Account type, Vendor Account type etc.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="color: red; font-family: "verdana" , sans-serif; font-size: 9.0pt;">Applied on</span></b><span style="font-family: "verdana" , sans-serif; font-size: 9.0pt;">: Dynamics AX 2012 R3 CU8.<br />
<b><span style="color: red;">Prerequisite</span></b>: Basic Dynamics AX
2012 programming knowledge.<br />
<b><span style="color: red;">Target audience</span></b>: AX programmers.<br />
<b><span style="color: red;">Assumption</span></b>: You are familiar
with Dynamics AX 2012.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt;">In Microsoft
Dynamics AX 2012 Account lookup works in a different way because dimension
structure change in comparison with Microsoft Dynamics AX 2009.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt;">Below
are some screenshots which give an idea what output we are going to achieve.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt;">A new
table created with two fields e.g. Account type (LedgerJournalACType) and
Account (LedgerDimensionAccount). The relation comes with the EDT when you drag
and drop the EDT to this table fields to create a new field.<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg24TJTclhIRRW4B0A0y54KDu69xPFbkrtIiNoIA6FL6_7-R418RmprxNnJ-Lzv3MhuNxlpROIMNs2bcLaEksrmMgqYFH2AEkeM88dthVwh_vROp0ZXVNqDEU_tlGqnsL22tCNc2Ucj8LXF/s1600/Blog_AccountTypeLookup1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="131" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg24TJTclhIRRW4B0A0y54KDu69xPFbkrtIiNoIA6FL6_7-R418RmprxNnJ-Lzv3MhuNxlpROIMNs2bcLaEksrmMgqYFH2AEkeM88dthVwh_vROp0ZXVNqDEU_tlGqnsL22tCNc2Ucj8LXF/s320/Blog_AccountTypeLookup1.png" width="320" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; mso-no-proof: yes;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; mso-no-proof: yes;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; mso-no-proof: yes;"><br /></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9pt; line-height: 107%;">Sample output of Ledger account type. When you select
Ledger it gives the segment option as well.</span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdYS05eKdTb_j9_mTpR_Nm-yBZ4ej0O4Nnej5JXlYIK7n7fMo73v_yjwE1bDAWDsK4sbGzC3rx7kBiwYX_M6dTLKHuGB2WG9lfGq65wfxK16IqQqAfOGYd8UU-Nr6PY9zAkp0PuSvAEOKo/s1600/Blog_AccountTypeLookup2.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="230" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdYS05eKdTb_j9_mTpR_Nm-yBZ4ej0O4Nnej5JXlYIK7n7fMo73v_yjwE1bDAWDsK4sbGzC3rx7kBiwYX_M6dTLKHuGB2WG9lfGq65wfxK16IqQqAfOGYd8UU-Nr6PY9zAkp0PuSvAEOKo/s320/Blog_AccountTypeLookup2.png" width="320" /></a></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;">Sample output of Customer account type.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihF5Y6B6l5vZ7oZSl28HtQcVK4DVBhq4BF2Yvj2Ju_wKRfvH4IBa9wsYhyplXSyFLdAtvSNSfZShbjmPrtUie0VyYWsNH5Uf9MpH6l90jaHN2rHyw8Byp8AOuah0wSBqqi5W8lPaPzWgbc/s1600/Blog_AccountTypeLookup3.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="115" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihF5Y6B6l5vZ7oZSl28HtQcVK4DVBhq4BF2Yvj2Ju_wKRfvH4IBa9wsYhyplXSyFLdAtvSNSfZShbjmPrtUie0VyYWsNH5Uf9MpH6l90jaHN2rHyw8Byp8AOuah0wSBqqi5W8lPaPzWgbc/s320/Blog_AccountTypeLookup3.png" width="320" /></a></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; mso-no-proof: yes;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; mso-no-proof: yes;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; mso-no-proof: yes;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; mso-no-proof: yes;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; mso-no-proof: yes;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; mso-no-proof: yes;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; mso-no-proof: yes;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9pt; line-height: 107%;">A new form created with two fields e.g. Account type and
Account. These are bound fields. Above table has been used as data source for
this form. Field Account (LedgerDimensionAccount) at form data source has two
methods called jumpRef() and resolveReference().</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; mso-no-proof: yes;"><!--[if gte vml 1]><v:shape id="Picture_x0020_7" o:spid="_x0000_i1026"
type="#_x0000_t75" style='width:228.75pt;height:267pt;visibility:visible;
mso-wrap-style:square'>
<v:imagedata src="file:///C:/Users/RBiswa01/AppData/Local/Temp/1/msohtmlclip1/01/clip_image005.png"
o:title=""/>
</v:shape><![endif]--></span><span style="font-family: "verdana" , sans-serif;"><o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOkgcbrOVd1QrMXJgMiUE0pS750eLXA782Bp1qOirmYIL6euccPBf-lHRdrUW_GTFpXhxhfsih5BtAPe1DLxQQzsZyolfyPozjg62xdgCLjgR5nrz9M2XwoCpKyKIKE9M9hTNnwz4WjVEz/s1600/Blog_AccountTypeLookup4.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOkgcbrOVd1QrMXJgMiUE0pS750eLXA782Bp1qOirmYIL6euccPBf-lHRdrUW_GTFpXhxhfsih5BtAPe1DLxQQzsZyolfyPozjg62xdgCLjgR5nrz9M2XwoCpKyKIKE9M9hTNnwz4WjVEz/s320/Blog_AccountTypeLookup4.png" width="274" /></a></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;">JumpRef() code:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="color: darkblue; font-family: "verdana" , sans-serif; font-size: 8.0pt;">public</span></b><span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">void</span></b> jumpRef()<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> dimOnlinePaymController.jumpRef();<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt; line-height: 107%;">}</span><span style="font-family: "verdana" , sans-serif;"><o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;">ResolveReference() code:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="color: darkblue; font-family: "verdana" , sans-serif; font-size: 8.0pt;">public</span></b><span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> Common
resolveReference(FormReferenceControl _formReferenceControl)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> Common common =
dimOnlinePaymController.resolveReference();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">return</span></b>
common;<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt; line-height: 107%;">}</span><span style="font-family: "verdana" , sans-serif;"><o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;">We have few more methods at form control level. For
Account field as control we need to take a segment entity control which should
be bounded to data source field called LedgerDimensionAccount. You can get this
control by right click on form design or field group or wherever you want.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;">On below screenshot we have a segment entry control and
it has 6 methods. Code for all these methods I mentioned here in this article.
The auto declare property of this control is set to Yes.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXX_XIe6iM44EmuOQECKn2c14dBHyxXJCmbeh76-86737sSdgsu3bFiqK43pLffvj9bE_GbeaFdbsvFB7L834HeE3c9Nb8akp_P-YFceVl6nzCRmU0Lfbfqy7c5jbYSiSE87_PismB_OOk/s1600/Blog_AccountTypeLookup5.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="230" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXX_XIe6iM44EmuOQECKn2c14dBHyxXJCmbeh76-86737sSdgsu3bFiqK43pLffvj9bE_GbeaFdbsvFB7L834HeE3c9Nb8akp_P-YFceVl6nzCRmU0Lfbfqy7c5jbYSiSE87_PismB_OOk/s320/Blog_AccountTypeLookup5.png" width="320" /></a></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;">Declaration at form level:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="color: darkblue; font-family: "verdana" , sans-serif; font-size: 8.0pt;">public</span></b><span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">class</span></b> FormRun <b><span style="color: darkblue;">extends</span></b>
ObjectRun<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> DimensionDynamicAccountController dimOnlinePaymController;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;">}<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;">Form init():<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="color: darkblue; font-family: "verdana" , sans-serif; font-size: 8.0pt;">public</span></b><span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">void</span></b> init()<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">super</span></b>();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> dimOnlinePaymController =
DimensionDynamicAccountController::construct(RBAccountTypeLookup_DS, <b><span style="color: darkblue;">fieldStr</span></b>(RBAccountTypeLookup,
LedgerDimensionAccount), <b><span style="color: darkblue;">fieldStr</span></b>(RBAccountTypeLookup,
LedgerJournalACType));<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> dimOnlinePaymController.parmIsDefaultAccount(<b><span style="color: darkblue;">true</span></b>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;">}<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;">Method at form control level:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="color: darkblue; font-family: "verdana" , sans-serif; font-size: 8.0pt;">public</span></b><span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">void</span></b> jumpRef()<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> dimOnlinePaymController.jumpRef();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;">}<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="color: darkblue; font-family: "verdana" , sans-serif; font-size: 8.0pt;">public</span></b><span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> Common
resolveReference(FormReferenceControl _formReferenceControl)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> Common common = dimOnlinePaymController.resolveReference();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">return</span></b>
common;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;">}<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;">Method at form control level:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="color: darkblue; font-family: "verdana" , sans-serif; font-size: 8.0pt;">public</span></b><span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">void</span></b> jumpRef()<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> dimOnlinePaymController.jumpRef();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;">}<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;">Method at form control level:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="color: darkblue; font-family: "verdana" , sans-serif; font-size: 8.0pt;">public</span></b><span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">void</span></b>
loadAutoCompleteData(LoadAutoCompleteDataEventArgs _e)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">super</span></b>(_e);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;">
dimOnlinePaymController.loadAutoCompleteData(_e);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;">}<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;">Method at form control level:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="color: darkblue; font-family: "verdana" , sans-serif; font-size: 8.0pt;">public</span></b><span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">void</span></b> loadSegments()<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">super</span></b>();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> dimOnlinePaymController.parmControl(this);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> dimOnlinePaymController.loadSegments();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: verdana, sans-serif; font-size: 8pt;">}</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;">Method at form control level:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="color: darkblue; font-family: "verdana" , sans-serif; font-size: 8.0pt;">public</span></b><span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">void</span></b> lookup()<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">switch</span></b>
(RBAccountTypeLookup.LedgerJournalACType)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> {<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">case</span></b>
LedgerJournalACType::Bank:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;">
BankAccountTable::lookupBankAccount(this);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">break</span></b>;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">case</span></b>
LedgerJournalACType::Cust:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> CustTable::lookupCustomer(this);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">break</span></b>;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">case</span></b>
LedgerJournalACType::FixedAssets:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> AssetTable::lookupAccountNum(this);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">break</span></b>;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">case</span></b>
LedgerJournalACType::Ledger:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">super</span></b>();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">break</span></b>;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">case</span></b>
LedgerJournalACType::Vend:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> VendTable::lookupVendor(this);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">break</span></b>;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">default</span></b>:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">super</span></b>();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">break</span></b>;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;">}<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;">Method at form control level:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="color: darkblue; font-family: "verdana" , sans-serif; font-size: 8.0pt;">public</span></b><span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">void</span></b> segmentValueChanged(SegmentValueChangedEventArgs
_e)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">super</span></b>(_e);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;">
dimOnlinePaymController.segmentValueChanged(_e);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;">}<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;">Method at form control level:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="color: darkblue; font-family: "verdana" , sans-serif; font-size: 8.0pt;">public</span></b><span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">boolean</span></b> validate()<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">boolean</span></b>
isValid;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> isValid = <b><span style="color: darkblue;">super</span></b>();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> isValid =
dimOnlinePaymController.validate() && isValid;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;"> <b><span style="color: darkblue;">return</span></b>
isValid;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "verdana" , sans-serif; font-size: 8.0pt;">}<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;">Save your work and try to run the form. <o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;">The above code is available in Microsoft Dynamics AX
2012. Only thing I did is assembled the required code here to make is handy. <o:p></o:p></span></div>
<br />
<div class="MsoNormal">
<span style="font-family: "verdana" , sans-serif; font-size: 9.0pt; line-height: 107%;">Hope this was useful for you. Feel free to leave your comments below.<o:p></o:p></span></div>
</div>
Rajesh Biswashttp://www.blogger.com/profile/07514591087556132461noreply@blogger.com0tag:blogger.com,1999:blog-7893807248327172219.post-61582776824483337722016-03-01T10:47:00.003-08:002016-03-01T11:04:49.140-08:00How to resolve TFS error appears because of client computer name change<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<span style="font-family: "calibri";">This article may answer your following questions.<o:p></o:p></span><br />
<ul style="text-align: left;">
<li>
<span style="font-family: "calibri";">How to resolve TFS error comes because of client computer name change?<o:p></o:p></span></li>
<li><span style="font-family: "calibri";">How to fix TFS workspace error appears because of computer name or system name change?<o:p></o:p></span></li>
<li><span style="font-family: "calibri";">How to fix the error “Workspace YourWorkspaceName; your name
does not reside on this computer. If this computer was recently renamed, the
workspace may be updated by running ‘tf workspaces/updateComputerName:oldComputerName’?<o:p></o:p></span></li>
</ul>
<br />
<div class="MsoNormal" style="margin: 0in 0in 8pt;">
<span style="font-family: "calibri";">I was using a VM (WMware) where TFS was connected with
workspace. At a certain point of time I had to change the computer name of my
VM. For TFS it’s a client computer where Dynamics AX is installed. I didn’t
realize that it will throw error because of computer name change. The error looks
like as shown below.<o:p></o:p></span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZrnBVshHfsK1_2dQxJrd7bzTJr1vXzXNyCzczE0nsfIGOF-bBuO8CqMgww0NuzLlLZ5BJG3VwFU1BEBAF44c8WO6IBcN5B4nDhoF1d6x2NvouJgLUd8AY6-4FMt5zF8i2iKqQLkOTxUZj/s1600/Image1TFS.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="152" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZrnBVshHfsK1_2dQxJrd7bzTJr1vXzXNyCzczE0nsfIGOF-bBuO8CqMgww0NuzLlLZ5BJG3VwFU1BEBAF44c8WO6IBcN5B4nDhoF1d6x2NvouJgLUd8AY6-4FMt5zF8i2iKqQLkOTxUZj/s320/Image1TFS.png" width="320" /></a></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 8pt;">
<span style="font-family: "calibri";">Why this happens? When we configure our workspace in Visual
Studio (VS) within VS or from Dynamics AX, VS stores the client computer name. <o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 8pt;">
<span style="font-family: "calibri";">What is the workaround? <o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 8pt;">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "calibri";">Option 1:<o:p></o:p></span></b></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 8pt;">
<span style="font-family: "calibri";">If you know in advance that TFS will throw error if client
computer name has changed in that case follow the steps below:<o:p></o:p></span></div>
<br />
<div class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: "calibri";">1)</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span style="font-family: "calibri";">Go to Visual Studio (VS) and remove the
workspace manually. <o:p></o:p></span></div>
<br />
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: "calibri";">2)</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span style="font-family: "calibri";">Change the client computer name.<o:p></o:p></span></div>
<br />
<div class="MsoListParagraphCxSpLast" style="margin: 0in 0in 8pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: "calibri";">3)</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span style="font-family: "calibri";">Go to VS and create a workspace for your client
computer with the new name.<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 8pt;">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "calibri";">Option 2:<o:p></o:p></span></b></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 8pt;">
<span style="font-family: "calibri";">If you are not aware of this issue that client computer name
change will not work with your existing VS workspace in that case follow the steps
below:<o:p></o:p></span></div>
<br />
<div class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 0pt 0.5in; mso-list: l1 level1 lfo2; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: "calibri";">1)</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span style="font-family: "calibri";">Open the command prompt with run as
administrator.<o:p></o:p></span></div>
<br />
<div class="MsoListParagraphCxSpLast" style="margin: 0in 0in 8pt 0.5in; mso-list: l1 level1 lfo2; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: "calibri";">2)</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span style="font-family: "calibri";">Run the command “tf workspaces
/updateComputerName:MyOldComputerName /s:[TFS URL]<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 8pt 0.5in;">
<span style="font-family: "calibri";">Collection: [Use TFS Collection path
e.g. tfsSysName.Domain.Com\TFS01]<o:p></o:p></span></div>
<span style="font-family: "calibri" , sans-serif; font-size: 11pt; line-height: 107%;">The above command will replace the old client
computer name with new one.</span><br />
<span style="font-family: "calibri" , sans-serif; font-size: 11pt; line-height: 107%;"></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4okeY-Gb71CdIuX-VcQkCLnaR9wuU7f2ZKYkZBqj7XA9E-6oY_vKcq4uLIyl8E6pMZQ-gWrwi5BSBJc31SljM9MAqRhY2loDda7Pcw47f_2t08Q9L6mvSSExkq2eCS5hsbCCoCCNq66Tw/s1600/Image2TFS.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="162" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4okeY-Gb71CdIuX-VcQkCLnaR9wuU7f2ZKYkZBqj7XA9E-6oY_vKcq4uLIyl8E6pMZQ-gWrwi5BSBJc31SljM9MAqRhY2loDda7Pcw47f_2t08Q9L6mvSSExkq2eCS5hsbCCoCCNq66Tw/s320/Image2TFS.png" width="320" /></a></div>
<span style="font-family: "calibri" , sans-serif; font-size: 11pt; line-height: 107%;"></span><br />
<br />
<span style="font-family: "calibri" , sans-serif; font-size: 11pt; line-height: 107%;"><span style="font-family: "times new roman"; font-size: small;">
</span><br />
</span><br />
<div class="MsoNormal" style="margin: 0in 0in 8pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt; line-height: 107%;">Leave your comments/feedback if this information was useful.<o:p></o:p></span></div>
<span style="font-family: "calibri" , sans-serif; font-size: 11pt; line-height: 107%;">
<span style="font-family: "times new roman"; font-size: small;">
</span></span></div>
Rajesh Biswashttp://www.blogger.com/profile/07514591087556132461noreply@blogger.com0tag:blogger.com,1999:blog-7893807248327172219.post-13639151296186969502015-02-24T08:59:00.001-08:002015-02-24T08:59:49.751-08:00How to fix Data Migration Framework (DIXF) error in Microsoft Dynamics AX 2012 R3<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Verdana, sans-serif;"><span style="font-size: x-small;">
</span><span style="font-size: small;"><span style="color: #333333; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">How to fix Data
Migration Framework (DIXF) error in Microsoft Dynamics AX 2012 R3<o:p></o:p></span></span></span><br />
<span style="font-family: Verdana, sans-serif;">
</span><br />
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="color: #333333; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"></span><span style="font-family: Verdana, sans-serif;"></span> </div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="color: #333333; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Verdana, sans-serif;"><strong>This article
addresses:<o:p></o:p></strong></span></span></div>
<span style="font-family: Verdana, sans-serif;">
</span><span style="color: #333333; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Verdana, sans-serif;">How to resolve Data
Import / Export Framework (DIXF) error. <o:p></o:p></span></span><br />
<span style="font-family: Verdana, sans-serif;">
</span><span style="color: #333333; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Verdana, sans-serif;">How to resolve data
upload error in Microsoft Dynamics AX 2012.<o:p></o:p></span></span><br />
<span style="font-family: Verdana, sans-serif;">
</span><span style="color: #333333; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Verdana, sans-serif;">How to resolve
error ‘could not load file or assembly … The system cannot find the file
specified.<o:p></o:p></span></span><br />
<span style="font-family: Verdana, sans-serif;">
</span><span style="color: #333333; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><o:p><span style="font-family: Verdana, sans-serif;"></span></o:p></span><br />
<span style="font-family: Verdana, sans-serif;">
</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmTIg45xvgkQRZGEW8J98F9F6gvZJ0iNJweJ778RTwPtvItZAliOdHNeFOpwlCJygQGN1PWMod3L9-6Av_Ti7DDG__WxW-bE7Bbsggs49A0jmj7lfwZK-O6L49kuPlBvES1X1LLffEsTqN/s1600/DIXF_Error1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmTIg45xvgkQRZGEW8J98F9F6gvZJ0iNJweJ778RTwPtvItZAliOdHNeFOpwlCJygQGN1PWMod3L9-6Av_Ti7DDG__WxW-bE7Bbsggs49A0jmj7lfwZK-O6L49kuPlBvES1X1LLffEsTqN/s1600/DIXF_Error1.png" height="320" width="266" /></a></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="color: #333333; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Times New Roman"; mso-no-proof: yes;"><!--[if gte vml 1]><v:shapetype
id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t"
path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f">
<v:stroke joinstyle="miter"/>
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0"/>
<v:f eqn="sum @0 1 0"/>
<v:f eqn="sum 0 0 @1"/>
<v:f eqn="prod @2 1 2"/>
<v:f eqn="prod @3 21600 pixelWidth"/>
<v:f eqn="prod @3 21600 pixelHeight"/>
<v:f eqn="sum @0 0 1"/>
<v:f eqn="prod @6 1 2"/>
<v:f eqn="prod @7 21600 pixelWidth"/>
<v:f eqn="sum @8 21600 0"/>
<v:f eqn="prod @7 21600 pixelHeight"/>
<v:f eqn="sum @10 21600 0"/>
</v:formulas>
<v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>
<o:lock v:ext="edit" aspectratio="t"/>
</v:shapetype><v:shape id="Picture_x0020_7" o:spid="_x0000_i1025" type="#_x0000_t75"
style='width:230.25pt;height:276.75pt;visibility:visible;mso-wrap-style:square'>
<v:imagedata src="file:///C:\Users\biswasra\AppData\Local\Temp\msohtmlclip1\01\clip_image001.png"
o:title=""/>
</v:shape><![endif]--><span style="font-family: Verdana, sans-serif;"></span></span><span style="color: #333333; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span><br /></div>
<span style="font-family: Verdana, sans-serif;">
</span><br />
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="color: #333333; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Verdana, sans-serif;"><span style="color: red;">Applied on</span>:
Dynamics AX 2012 R3.<br />
<span style="color: red;">Prerequisite</span>: Basic Dynamics AX 2012 programming knowledge.<br />
<span style="color: red;">Target audience</span>: AX programmers.<br />
<span style="color: red;">Assumption</span>: You are familiar with Dynamics AX 2012.<o:p></o:p></span></span></div>
<span style="font-family: Verdana, sans-serif;">
</span><br />
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="color: #333333; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Verdana, sans-serif;">When you get an
error to upload data using Data Migration Framework (DIXF), check below things.<o:p></o:p></span></span></div>
<span style="font-family: Verdana, sans-serif;">
</span><br />
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="color: #333333; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Verdana, sans-serif;">- Data Import /
Export Framework (DIXF) service should be installed on a computer running SQL
Server Integration Services. This component provides the connection to SQL
Server Integration Services. </span></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="color: #333333; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Verdana, sans-serif;">In order to
complete the installation, you must provide an account for the service to run
as. AOS service account is recommended.</span></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="color: #333333; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Verdana, sans-serif;"><o:p></o:p></span></span> </div>
<span style="font-family: Verdana, sans-serif;">
</span><br />
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="color: #333333; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Verdana, sans-serif;">- AOS component
should be installed on AOS server that connects the AOS to the Data
Import/Export Framework service. If AOS component is installed correctly you
should get a folder called <span style="mso-spacerun: yes;"> </span>DataImportExportFramework
under default location “C:\Program Files\Microsoft Dynamics AX\60” on AOS
server. Inside this folder you should have:<o:p></o:p></span></span></div>
<span style="font-family: Verdana, sans-serif;">
</span><br />
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="color: #333333; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Verdana, sans-serif;">DMFConfig<o:p></o:p></span></span></div>
<span style="font-family: Verdana, sans-serif;">
</span><span style="color: #333333; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Verdana, sans-serif;">Microsoft.Dynamics.AX.Framework.Tools.DMF.DriverHelper<o:p></o:p></span></span><br />
<span style="font-family: Verdana, sans-serif;">
</span><span style="color: #333333; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Verdana, sans-serif;">Microsoft.Dynamics.AX.Framework.Tools.DMF.SSISHelper<o:p></o:p></span></span><br />
<span style="font-family: Verdana, sans-serif;">
</span><span style="color: #333333; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Verdana, sans-serif;">Microsoft.Dynamics.AX.Framework.Tools.DMF.SSISHelperService<o:p></o:p></span></span><br />
<span style="font-family: Verdana, sans-serif;">
</span><span style="color: #333333; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Verdana, sans-serif;">Microsoft.Dynamics.AX.Framework.Tools.DMF.SSISHelperService.exe</span></span><br />
<span style="color: #333333; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Verdana, sans-serif;"><o:p></o:p></span></span><br />
<span style="font-family: Verdana, sans-serif;">
</span><br />
<span style="font-family: Verdana, sans-serif;">
</span><span style="color: #333333; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Verdana, sans-serif;">- Client component
should be installed on client system. It installs the user interface component
of the Data Import/Export Framework. If client component is installed correctly
the client bin folder should have 4 DLLs e.g. <o:p></o:p></span></span><br />
<span style="font-family: Verdana, sans-serif;">
</span><br />
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="color: #333333; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Verdana, sans-serif;">Microsoft.Dynamics.AX.Framework.Tools.DMF.DriverHelper.dll,
Microsoft.Dynamics.AX.Framework.Tools.DMF.Mapper.dll, Microsoft.Dynamics.AX.Framework.Tools.DMF.PreviewGrid.dll,
Microsoft.Dynamics.AX.Framework.Tools.DMF.ServiceProxy.dll<o:p></o:p></span></span></div>
<span style="font-family: Verdana, sans-serif;">
</span><br />
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="color: #333333; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Verdana, sans-serif;">The default
location for these files is “C:\Program Files (x86)\Microsoft Dynamics
AX\60\Client\Bin” on client machine. Your AOS server can be a client as well.</span></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="color: #333333; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Verdana, sans-serif;"><o:p></o:p></span></span> </div>
<span style="font-family: Verdana, sans-serif;">
</span><br />
<div class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 0pt 0.25in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
<span style="font-family: Verdana, sans-serif;"><span style="color: #333333; mso-bidi-font-family: Calibri; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;">-<span style="font-family: "Times New Roman"; font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
</span></span></span><span style="color: #333333; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Open your AX client and go to Data import export framework module
> Setup > <strong>Data import/export framework parameters</strong>. On this form you need
to define a share folder path and validate. Important thing is the service
account assigned to Data Import / Export Framework (DIXF) service on SQL server
<strong>should have access to this folder</strong>.<o:p></o:p></span></span></div>
<span style="font-family: Verdana, sans-serif;">
</span><br />
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.25in; mso-add-space: auto;">
<span style="color: #333333; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><o:p><span style="font-family: Verdana, sans-serif;"> </span></o:p></span></div>
<span style="font-family: Verdana, sans-serif;">
</span><br />
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.25in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
<span style="font-family: Verdana, sans-serif;"><span style="color: #333333; mso-bidi-font-family: Calibri; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;">-<span style="font-family: "Times New Roman"; font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> </span></span></span><span style="color: #333333; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">On AOS server go to Start > Administrative Tools > Server
Manager > Configuration > Local Users and Groups > <strong>Groups</strong>. In this
Groups folder there must a group called <strong>Microsoft Dynamics AX Data Import
Export Framework Service Users</strong>. In this group add service account (user ID)
which you used for DIXF on SQL server. Also add users will be accessing DIXF.<o:p></o:p></span></span></div>
<span style="font-family: Verdana, sans-serif;">
</span><span style="color: #333333; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><o:p><span style="font-family: Verdana, sans-serif;"> </span></o:p></span><br />
<span style="font-family: Verdana, sans-serif;">
</span><br />
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.25in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
<span style="font-family: Verdana, sans-serif;"><span style="color: #333333; mso-bidi-font-family: Calibri; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;">-<span style="font-family: "Times New Roman"; font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> </span></span></span><span style="color: #333333; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Open your AX client and go to System administration > Setup
> Services and Application Integration Framework > <strong>Inbound ports</strong> > make
sure <strong>DMFService</strong> is activated.<o:p></o:p></span></span></div>
<span style="font-family: Verdana, sans-serif;">
</span><br />
<div class="MsoListParagraphCxSpLast" style="margin: 0in 0in 0pt 0.5in;">
<span style="color: #333333; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><o:p><span style="font-family: Verdana, sans-serif;"> </span></o:p></span></div>
<span style="font-family: Verdana, sans-serif;">
<span style="color: #333333; font-family: "Calibri","sans-serif"; mso-ansi-language: EN-US; mso-bidi-font-family: Arial; mso-bidi-font-size: 11.5pt; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><span style="font-family: Verdana, sans-serif;">Hope this was useful for you. Leave your comment below<br /><br /></span></span></span></div>
Rajesh Biswashttp://www.blogger.com/profile/07514591087556132461noreply@blogger.com0tag:blogger.com,1999:blog-7893807248327172219.post-2677013797269099032015-01-11T18:32:00.004-08:002015-01-11T18:32:53.462-08:00How to fix error Invalid object name tempdb.DBO and TRUNCATE TABLE tempdb. DBO in Microsoft Dynamics AX 2012<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "Calibri","sans-serif"; line-height: 115%; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">How
to fix error Invalid object name tempdb.DBO and TRUNCATE TABLE tempdb. DBO in Microsoft
Dynamics AX 2012.</span><br />
<span style="font-family: "Calibri","sans-serif"; line-height: 115%; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"></span><br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: "Vrinda","sans-serif";">This article explain
how to resolve tempdb.DBO error and TRUNCATE TABLE tempdb. DBO when you do a posting
in Microsoft Dynamics AX 2012<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<b style="mso-bidi-font-weight: normal;"><span style="color: red; font-family: "Vrinda","sans-serif";">Applied on:</span></b><span style="font-family: "Vrinda","sans-serif";">
Dynamics AX 2012 R3<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<b style="mso-bidi-font-weight: normal;"><span style="color: red; font-family: "Vrinda","sans-serif";">Error</span></b><span style="color: red; font-family: "Vrinda","sans-serif";">:</span><span style="font-family: "Vrinda","sans-serif";"><o:p></o:p></span></div>
<span style="font-family: "Vrinda","sans-serif";">SQL error description:
[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid object name
'tempdb.DBO.t20143_ADF272F84AED47BF8B58C5DF75F56229'.<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: "Vrinda","sans-serif";">SQL statement: TRUNCATE
TABLE tempdb."DBO".t20143_ADF272F84AED47BF8B58C5DF75F56229<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<b style="mso-bidi-font-weight: normal;"><span style="color: red; font-family: "Vrinda","sans-serif";">Symptom:</span></b><b style="mso-bidi-font-weight: normal;"><span style="font-family: "Vrinda","sans-serif";"><o:p></o:p></span></b></div>
<span style="font-family: "Vrinda","sans-serif";">Sometimes when you do
posting in Microsoft Dynamics AX 2012 it throws an error which says like [Microsoft][SQL
Server Native Client 11.0][SQL Server]Invalid object name
'tempdb.DBO.t20143_ADF272F84AED47BF8B58C5DF75F56229 also says SQL statement:
TRUNCATE TABLE tempdb."DBO".t20143_ADF272F84AED47BF8B58C5DF75F56229.<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: "Vrinda","sans-serif";">Sample screenshot:<o:p></o:p></span></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0ZH2ByndGmX6BHS-Dl120HoeyjmB5p1plBAeTEYjo-p-AdA_YKYNp8SNcyfpZcAEEMGTLs_KLqS1hIvz00Ek21gNeQsSZaxsQQue6tS8y0pIUSrR_j1AM91-Ms8c2Ot6viNlPhMhFkZ2c/s1600/TempDB_Error.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0ZH2ByndGmX6BHS-Dl120HoeyjmB5p1plBAeTEYjo-p-AdA_YKYNp8SNcyfpZcAEEMGTLs_KLqS1hIvz00Ek21gNeQsSZaxsQQue6tS8y0pIUSrR_j1AM91-Ms8c2Ot6viNlPhMhFkZ2c/s1600/TempDB_Error.png" height="201" width="320" /></a><br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: "Vrinda","sans-serif"; mso-no-proof: yes;"><v:shapetype coordsize="21600,21600" filled="f" id="_x0000_t75" o:preferrelative="t" o:spt="75" path="m@4@5l@4@11@9@11@9@5xe" stroked="f">
<v:stroke joinstyle="miter">
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0">
<v:f eqn="sum @0 1 0">
<v:f eqn="sum 0 0 @1">
<v:f eqn="prod @2 1 2">
<v:f eqn="prod @3 21600 pixelWidth">
<v:f eqn="prod @3 21600 pixelHeight">
<v:f eqn="sum @0 0 1">
<v:f eqn="prod @6 1 2">
<v:f eqn="prod @7 21600 pixelWidth">
<v:f eqn="sum @8 21600 0">
<v:f eqn="prod @7 21600 pixelHeight">
<v:f eqn="sum @10 21600 0">
</v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:formulas>
<v:path gradientshapeok="t" o:connecttype="rect" o:extrusionok="f">
<o:lock aspectratio="t" v:ext="edit">
</o:lock></v:path></v:stroke></v:shapetype><v:shape id="Picture_x0020_1" o:spid="_x0000_i1025" style="height: 280.5pt; mso-wrap-style: square; visibility: visible; width: 445.5pt;" type="#_x0000_t75">
<v:imagedata o:title="" src="file:///C:\Users\biswasra\AppData\Local\Temp\msohtmlclip1\01\clip_image001.png">
</v:imagedata></v:shape></span><span style="font-family: "Vrinda","sans-serif";"><o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: "Vrinda","sans-serif";"><o:p></o:p></span> </div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: "Vrinda","sans-serif";"><o:p></o:p></span> </div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: "Vrinda","sans-serif";"><o:p></o:p></span> </div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: "Vrinda","sans-serif";"><o:p></o:p></span> </div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: "Vrinda","sans-serif";"><o:p></o:p></span> </div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: "Vrinda","sans-serif";"><o:p></o:p></span> </div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: "Vrinda","sans-serif";"><o:p> </o:p></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<b style="mso-bidi-font-weight: normal;"><span style="color: red; font-family: "Vrinda","sans-serif";"></span></b> </div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<b style="mso-bidi-font-weight: normal;"><span style="color: red; font-family: "Vrinda","sans-serif";"></span></b> </div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<b style="mso-bidi-font-weight: normal;"><span style="color: red; font-family: "Vrinda","sans-serif";"></span></b> </div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<b style="mso-bidi-font-weight: normal;"><span style="color: red; font-family: "Vrinda","sans-serif";"></span></b> </div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<b style="mso-bidi-font-weight: normal;"><span style="color: red; font-family: "Vrinda","sans-serif";">Resolution:</span></b><b style="mso-bidi-font-weight: normal;"><span style="font-family: "Vrinda","sans-serif";"><o:p></o:p></span></b></div>
<span style="font-family: "Vrinda","sans-serif";">Solution is to restart
the AOS.</span><br />
<span style="font-family: Vrinda;"></span><br />
<span style="font-family: Vrinda;"></span><br />
<span style="font-family: Vrinda;"></span><o:p></o:p> </div>
Rajesh Biswashttp://www.blogger.com/profile/07514591087556132461noreply@blogger.com1tag:blogger.com,1999:blog-7893807248327172219.post-41410052737325652722015-01-06T06:42:00.000-08:002015-01-09T13:01:05.754-08:00How to read and insert record from a CSV file using X++ code into Microsoft Dynamics AX 2012 table<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="color: #333333; font-family: "Calibri","sans-serif"; font-size: 11.5pt; line-height: 115%; mso-ansi-language: EN-US; mso-bidi-font-family: Arial; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;">How to read and insert record from a CSV file
using X++ code into Microsoft Dynamics AX 2012 table.</span><br />
<br />
<span style="color: #333333; font-family: "Calibri","sans-serif"; font-size: 11.5pt; line-height: 115%; mso-ansi-language: EN-US; mso-bidi-font-family: Arial; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;">This article helps you to understand how to read
data from a CSV file and insert into Microsoft Dynamics AX 2012 table.</span><br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<b><span style="color: red; font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: Arial; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">Applied on</span></span></b><span style="font-family: Calibri;"><span style="color: #333333; font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: Arial; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;">: Dynamics AX 2012 R3.<br />
</span><b><span style="color: red; font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: Arial; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;">Prerequisite</span></b></span><span style="font-family: Calibri;"><span style="color: #333333; font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: Arial; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;">: Basic Dynamics AX 2012 programming knowledge.<br />
</span><b><span style="color: red; font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: Arial; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;">Target audience</span></b></span><span style="font-family: Calibri;"><span style="color: #333333; font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: Arial; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;">: AX programmers.<br />
</span><b><span style="color: red; font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: Arial; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;">Assumption</span></b><span style="color: #333333; font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: Arial; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;">: You are familiar with Dynamics AX 2012 and CSV file</span><span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></span></div>
<br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="color: #333333; font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: Arial; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">Below job inserts records from a CSV file to CustGroup table.<o:p></o:p></span></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<b><span style="color: darkblue; font-family: Consolas; font-size: 8pt;">static</span></b><span style="font-family: Consolas; font-size: 8pt;"> <b><span style="color: darkblue;">void</span></b>
CustGroupCSVInsert(Args _args)<o:p></o:p></span></div>
<span style="font-family: Consolas; font-size: 8pt;">{<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>Dialog<span style="mso-spacerun: yes;"> </span>dialog<span style="mso-spacerun: yes;"> </span>= <b><span style="color: darkblue;">new</span></b>
Dialog();<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>DialogField<span style="mso-spacerun: yes;"> </span>dialogField;<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>AsciiIo<span style="mso-spacerun: yes;"> </span>importFile;<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">str</span></b><span style="mso-spacerun: yes;"> </span>filePath,fileNameOnly;<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>filetype<span style="mso-spacerun: yes;"> </span>type;<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">container</span></b><span style="mso-spacerun: yes;"> </span>record;<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">str</span></b><span style="mso-spacerun: yes;"> </span>delimiter = <span style="color: darkred;">","</span>;<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">int</span></b><span style="mso-spacerun: yes;"> </span>totalRecords;<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>CustGroup<span style="mso-spacerun: yes;"> </span>custGrp;<o:p></o:p></span><br />
<br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>dialogField=dialog.addField(<b><span style="color: darkblue;">extendedTypeStr</span></b>(FilenameOpen),<span style="color: darkred;">"Select File"</span>,<span style="color: darkred;">"Select
file to import"</span>);<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>dialog.caption(<span style="color: darkred;">"File Picker"</span>);<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>dialog.filenameLookupFilter([<span style="color: darkred;">'csv'</span>,<span style="color: darkred;">'*.csv'</span>]);<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">if</span></b>(!dialog.run())<o:p></o:p></span></div>
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">return</span></b>;<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>[filePath, fileNameOnly, type] = fileNameSplit(dialogField.value());<o:p></o:p></span></div>
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>importFile = <b><span style="color: darkblue;">new</span></b>
AsciiIo(dialogField.value(), <span style="color: darkred;">'R'</span>);<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">if</span></b>((!importFile)
|| (importFile.status() != IO_Status::Ok))<o:p></o:p></span></div>
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>warning(<span style="color: darkred;">"Error in opening import
file"</span>);<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">throw</span></b>(Exception::Error);<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>importFile.inFieldDelimiter(Delimiter);<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span></span><span style="font-family: Consolas; font-size: 8pt;"><b><span style="color: darkblue;">try</span></b><o:p></o:p></span></div>
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">ttsbegin</span></b>;<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>custGrp.clear();<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>record = importFile.read(); <i><span style="color: green;">// First row -
Column name - Header</span></i><o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">while</span></b>(importFile.status() ==<span style="mso-spacerun: yes;"> </span>IO_Status::Ok)<o:p></o:p></span></div>
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>record = importFile.read();<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">if</span></b>(!record)<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span><b><span style="color: darkblue;">break</span></b>;<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>totalRecords = totalRecords + <b><span style="color: red;">1</span></b>;<o:p></o:p></span></div>
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>custGrp.clear();<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>custGrp.CustGroup = <b><span style="color: darkblue;">conPeek</span></b>(record,
<b><span style="color: red;">1</span></b>);<o:p></o:p></span></div>
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>custGrp.Name = <b><span style="color: darkblue;">conPeek</span></b>(record,<b><span style="color: red;">2</span></b>);<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>custGrp.insert();<o:p></o:p></span></div>
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">ttscommit</span></b>;<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">catch</span></b>(Exception::Error)<o:p></o:p></span></div>
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">Throw</span></b>(Exception::Error);<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span>info(<b><span style="color: darkblue;">strFmt</span></b>(<span style="color: darkred;">"Total
Read Records = %1"</span>,totalRecords));<o:p></o:p></span></div>
<span style="font-family: Consolas; font-size: 8pt;">}</span><br />
<br />
<br />
Sample .CSV file image. <br />
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrreTB3qHyYKxJB0if-7b-dGG3NY8r89VJVRTkqzURCo7CVvRnyL1fTNf3RvnqComNgrAtkrVGqmSFynLN5vmtzVo1rx_lK6bP17hlJaet5O6htFgvmZyWsLD5esx6VytlVw5t2xTtKGqP/s1600/Sample_CSV_File.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrreTB3qHyYKxJB0if-7b-dGG3NY8r89VJVRTkqzURCo7CVvRnyL1fTNf3RvnqComNgrAtkrVGqmSFynLN5vmtzVo1rx_lK6bP17hlJaet5O6htFgvmZyWsLD5esx6VytlVw5t2xTtKGqP/s1600/Sample_CSV_File.png" /></a></div>
<br />
<br />
<br />
</div>
Rajesh Biswashttp://www.blogger.com/profile/07514591087556132461noreply@blogger.com0tag:blogger.com,1999:blog-7893807248327172219.post-31579696336697632912014-08-15T11:14:00.003-07:002016-07-25T05:42:23.707-07:00How to execute parallel compilation command on server side using AxBuild.exe for Microsoft Dynamics AX 2012 CU7 onwards<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "verdana" , "sans-serif"; font-size: 10pt; line-height: 115%;">How to execute parallel
compilation command on server side using AxBuild.exe for Microsoft Dynamics AX 2012 CU7
onwards<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;">Overview: <o:p></o:p></span></b></div>
<span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;">The AxBuild.exe utility program enables you to
accomplish a full compile of all the X++ code on your system much faster than
you can with the MorphX client (native way). AxBuild.exe is run at a command
prompt on a computer that hosts the Application Object Server (AOS). This
approach eliminates the burden of transferring metadata between the AOS machine
and the client machine. It starts several parallel processes and divides pieces
of the full compile among them. Each piece is called worker. One set of workers
generates 6 worker windows. It depends on the system that how many set of
workers system will generate to make compilation faster. <o:p></o:p></span><br />
<br />
<div style="margin: 0in 0in 0pt;">
<span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;">AxBuild.exe is available in Microsoft Dynamics
AX 2012 R3 or AX 2012 R2 + cumulative update 7 or later. <o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;">How to do it:<o:p></o:p></span></b></div>
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;">Step1</span></b><span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;">:
Log on to your AOS server for which you want to start the compilation.<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;">Step2</span></b><span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;">:
On AOS server go to Start on task bar and compose cmd in Run to open command
prompt.<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;">Step3</span></b><span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;">:
Go to the bin folder of your AOS application. By default it should be “C:\Program
Files\Microsoft Dynamics AX\60\Server\<your application="" folder="" name="">\bin\”.
In this folder you will get AxBuild.exe executable file. Make sure the file is
existing here. Note that the folder path can be different based on your
installation.<o:p></o:p></your></span></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVwYvnfuWjbB-nZjkKLsly1FHFSg8ig4pMnf-0wTRwOpHtJnpjlawUFUB1T2SQmO2qu_xZ7FnjubwmihKm5hPZtUNhxYLf5i97qxKJ5o_p9IkhaMJdJ8tKiuB7U-UTfOWQK7MUe957B1i4/s1600/AxBuild1.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="65" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVwYvnfuWjbB-nZjkKLsly1FHFSg8ig4pMnf-0wTRwOpHtJnpjlawUFUB1T2SQmO2qu_xZ7FnjubwmihKm5hPZtUNhxYLf5i97qxKJ5o_p9IkhaMJdJ8tKiuB7U-UTfOWQK7MUe957B1i4/s1600/AxBuild1.jpg" width="320" /></a><br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;"><!--[if gte vml 1]><v:shapetype coordsize="21600,21600" filled="f" id="_x0000_t75" o:preferrelative="t" o:spt="75" path="m@4@5l@4@11@9@11@9@5xe" stroked="f">
<v:stroke joinstyle="miter">
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0">
<v:f eqn="sum @0 1 0">
<v:f eqn="sum 0 0 @1">
<v:f eqn="prod @2 1 2">
<v:f eqn="prod @3 21600 pixelWidth">
<v:f eqn="prod @3 21600 pixelHeight">
<v:f eqn="sum @0 0 1">
<v:f eqn="prod @6 1 2">
<v:f eqn="prod @7 21600 pixelWidth">
<v:f eqn="sum @8 21600 0">
<v:f eqn="prod @7 21600 pixelHeight">
<v:f eqn="sum @10 21600 0">
</v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:formulas>
<v:path gradientshapeok="t" o:connecttype="rect" o:extrusionok="f">
<o:lock aspectratio="t" v:ext="edit">
</o:lock></v:path></v:stroke></v:shapetype><v:shape id="Picture_x0020_3" o:spid="_x0000_i1028" style="height: 87.75pt; visibility: visible; width: 6in;" type="#_x0000_t75">
<v:imagedata o:title="" src="file:///C:\Users\biswasra\AppData\Local\Temp\msohtmlclip1\01\clip_image001.png">
</v:imagedata></v:shape></span><span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;"><o:p></o:p></span><br />
<span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;"><o:p></o:p></span><br />
<span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;"><o:p></o:p></span><br />
<span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;"><o:p></o:p></span><br />
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;">Step4</span></b><span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;">: Now you need to compose and execute the command. The
command is AxBuild.exe xppCompileAll /s=01 “C:\Program files (x86)\Microsoft
Dynamics AX\60\Client\Bin”. First parameter is to compile the application in
whole, scond parameter is to consider the service number from AOS server. You
may have more than one service on your AOS server. Third parameter is referring
client bin folder if anything to be considered from there. The command window
looks like:<o:p></o:p></span></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFPZCMIp4SIyzYh30x2gja-KvhzqMVfU4RYY20wocu9NhKe5n0tveeOCdYW7q4jKZKyNH1JaZZpFw9mfyKpebO_qr08Ym5rjKAIYpQzYd1Silk2CpbMHuxiS38DCI9DUEt9PW2hMQjVqdq/s1600/AxBuild2.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="85" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFPZCMIp4SIyzYh30x2gja-KvhzqMVfU4RYY20wocu9NhKe5n0tveeOCdYW7q4jKZKyNH1JaZZpFw9mfyKpebO_qr08Ym5rjKAIYpQzYd1Silk2CpbMHuxiS38DCI9DUEt9PW2hMQjVqdq/s1600/AxBuild2.jpg" width="320" /></a><br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;"><!--[if gte vml 1]><v:shape id="Picture_x0020_4" o:spid="_x0000_i1027" style="height: 116.25pt; visibility: visible; width: 434.25pt;" type="#_x0000_t75">
<v:imagedata o:title="" src="file:///C:\Users\biswasra\AppData\Local\Temp\msohtmlclip1\01\clip_image002.png">
</v:imagedata></v:shape><o:p></o:p></span><br />
<span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;"><o:p></o:p></span><br />
<span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;"><o:p></o:p></span><br />
<span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;"><o:p></o:p></span><br />
<span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;"><o:p></o:p></span><br />
<span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;"><o:p></o:p></span><br />
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;">Step5</span></b><span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;">:
Execute the command by pressing Enter key of your key board.<o:p></o:p></span></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAMiDSyAaGp5muPDtQBho6uDIN2xbwVTFZWHDiVFnCYpxBaYGewd4ZEbYk4S4WQBF-JXkKMKw5iMiFzrE5l3Vupe9qVTFFAY0d8BpYAdNIFqq_5Bgn_rC_Ds2V8kNwdxtROZw1HgapRIHn/s1600/AxBuild3.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="158" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAMiDSyAaGp5muPDtQBho6uDIN2xbwVTFZWHDiVFnCYpxBaYGewd4ZEbYk4S4WQBF-JXkKMKw5iMiFzrE5l3Vupe9qVTFFAY0d8BpYAdNIFqq_5Bgn_rC_Ds2V8kNwdxtROZw1HgapRIHn/s1600/AxBuild3.jpg" width="320" /></a><br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;"><!--[if gte vml 1]><v:shape id="Picture_x0020_5" o:spid="_x0000_i1026" style="height: 232.5pt; visibility: visible; width: 468pt;" type="#_x0000_t75">
<v:imagedata o:title="" src="file:///C:\Users\biswasra\AppData\Local\Temp\msohtmlclip1\01\clip_image003.png">
</v:imagedata></v:shape></span><span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;"><o:p></o:p></span><br />
<span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;"><o:p></o:p></span><br />
<span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;"><o:p></o:p></span><br />
<span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;"><o:p></o:p></span><br />
<span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;"><o:p></o:p></span><br />
<span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;"><o:p></o:p></span><br />
<span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;"><o:p></o:p></span><br />
<span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;"><o:p></o:p></span><br />
<span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;"><o:p></o:p></span><br />
<span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;"><o:p></o:p></span><br />
<span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;"><o:p></o:p></span><br />
<span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;">Once compilation is over it shows the details like when
completed, how much time it took, log file location, number of workers
completed the compilation etc.<o:p></o:p></span></div>
<span style="font-family: "verdana" , "sans-serif"; font-size: 10pt;">Dynamics AX R2 was taking 4.5 hours to complete
application compilation with native way but new way of compilation using
AxBuild.exe only takes few minutes, not even an hour. It may take more than one
hour if there are 6 workers. <o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: "verdana" , "sans-serif"; font-size: 10pt; line-height: 115%;">You may leave your
comments below.</span></div>
</div>
Rajesh Biswashttp://www.blogger.com/profile/07514591087556132461noreply@blogger.com1tag:blogger.com,1999:blog-7893807248327172219.post-80855089717380296852014-05-08T14:07:00.001-07:002014-05-08T14:07:33.637-07:00Microsoft Dynamics AX 2012 Database Entity Relationship Diagrams<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Verdana, sans-serif;">Hello,</span><br />
<span style="font-family: Verdana, sans-serif;"></span><br />
<span style="font-family: Verdana, sans-serif;">After a long time I got a chance to write here.</span><br />
<span style="font-family: Verdana, sans-serif;">I was surfing internet and came out with a very useful link </span><a href="http://www.microsoft.com/dynamics/ax/erd/ax2012r2/"><span style="font-family: Verdana, sans-serif;">http://www.microsoft.com/dynamics/ax/erd/ax2012r2/</span></a><span style="font-family: Verdana, sans-serif;"> which tells about Microsoft Dynamics AX 2012 Database Entity Relationship Diagrams.</span><br />
<span style="font-family: Verdana, sans-serif;"></span><br />
<span style="font-family: Verdana;">This link can answers your questions like:</span><br />
<span style="font-family: Verdana;">How to know Microsoft Dynamics AX 2012 table relations? </span><br />
<span style="font-family: Verdana;">In Microsoft dynamics AX 2012 how to know tables per module?</span><br />
<span style="font-family: Verdana;">In Microsoft dynamics AX 2012 how to know parent child relationship for tables?</span><br />
<span style="font-family: Verdana;"></span><br />
<span style="font-family: Verdana, sans-serif;">You can explore the content by Module.</span><br />
<span style="font-family: Verdana, sans-serif;">This link is very useful for AX developers as well as functional people who are interested to know about Microsoft dynamics AX 2012 table relationship.</span><br />
<br />
<span style="font-family: Verdana;"></span><br />
<span style="font-family: Verdana;">You may leave your comments below.</span><br />
<span style="font-family: Verdana, sans-serif; font-size: x-small;"></span><br />
</div>
Rajesh Biswashttp://www.blogger.com/profile/07514591087556132461noreply@blogger.com0tag:blogger.com,1999:blog-7893807248327172219.post-57684493673071137932014-04-11T10:20:00.000-07:002014-04-11T10:21:22.777-07:00How to fix synchronization error ‘Cannot create a record in Version control changes (SysVersionControlTmpChange)’ with TFS while importing?<div dir="ltr" style="text-align: left;" trbidi="on">
<span lang="EN-US"><span style="font-family: Calibri;">How to fix synchronization error ‘Cannot create a
record in Version control changes (SysVersionControlTmpChange)’ with TFS while
importing?</span></span><br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;">
<span lang="EN-US"><span style="font-family: Calibri;"><span style="color: red;"><strong>Applied on</strong></span>: Dynamics AX 2012 R2<br />
<strong><span style="color: red;">Prerequisite</span></strong>: Basic Dynamics AX 2012 programming knowledge & basic
knowledge of how to use Team Foundation Server (TFS).<br />
<strong><span style="color: red;">Target audience</span></strong>: AX programmers<br />
<strong><span style="color: red;">Assumption</span></strong>: You are familiar with Dynamics AX 2012, TFS and Visual Studio .Net</span></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;">
<span lang="EN-US"><span style="font-family: Calibri;"><strong><span style="color: red;">Symptom</span></strong>:</span></span></div>
<br />
<div class="MsoListParagraph" style="line-height: normal; margin: 0cm 0cm 0pt 36pt; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -18pt;">
<span lang="EN-US" style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">1)</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";"> </span></span></span><span lang="EN-US"><span style="font-family: Calibri;">When you try to synchronize a
model with Team Foundation Server (TFS), it throws error like “Cannot create a
record in Version control changes (SysVersionControlTmpChange). Change Number:
[a numeric number]. The record already exists.”</span></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;">
<span lang="EN-US"><o:p><span style="font-family: Calibri;"> </span></o:p></span></div>
<div class="MsoListParagraphCxSpFirst" style="line-height: normal; margin: 0cm 0cm 0pt 36pt; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -18pt;">
<span lang="EN-US" style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">2)</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";"> </span></span></span><span lang="EN-US"><span style="font-family: Calibri;">You try to synchronize an
object with TFS and system throws errors “Cannot create a record in Version
control changes (SysVersionControlTmpChange). Change Number: [a numeric
number]. The record already exists.”</span></span></div>
<br />
<div class="MsoListParagraphCxSpMiddle" style="margin: 0cm 0cm 0pt 36pt;">
<span lang="EN-US"><o:p><span style="font-family: Calibri;"> </span></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje9KH0JIRDnouC-1blOpVSM-ym6v2-VK9J1qknr7fnlJxBvvWWlH6JVxpcckTU12OPSAeZrXHJ1S_96peGYNuG7i1haLAtCzTsLJTZAMabBKvsVx5_jlv5bR3vQbME4RwEWX2Ftmd-0skJ/s1600/TFSSync1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje9KH0JIRDnouC-1blOpVSM-ym6v2-VK9J1qknr7fnlJxBvvWWlH6JVxpcckTU12OPSAeZrXHJ1S_96peGYNuG7i1haLAtCzTsLJTZAMabBKvsVx5_jlv5bR3vQbME4RwEWX2Ftmd-0skJ/s1600/TFSSync1.png" height="320" width="268" /></a></div>
<div style="text-align: center;">
<span lang="EN-US"><span style="font-family: Calibri;">A sample error.</span></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;">
<span lang="EN-US"><o:p><span style="font-family: Calibri;"> </span></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;">
<span lang="EN-US"><span style="font-family: Calibri;">I was facing the above error and came up with a
solution as below.</span></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;">
<span lang="EN-US"><span style="font-family: Calibri;">The above screenshot shows a RecID “5637527359”. I
searched for this RecID in SysVersionControlSynchronizeLog table record and got
the record, noticed that ItemPath field of this searched record shows a value
where I can see AOT path for a view called DirPartyPostalAddressView.</span></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;">
<span lang="EN-US"><span style="font-family: Calibri;">Then I searched SysVersionControlSynchronizeLog table for
view DirPartyPostalAddressView using ItemPath field as shown below.</span></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5CQb2VYnhWxeX2EPZ-aD4DP_M6M-HZpqM4n7HHdHCAcKFVCd7uQ7yfMdKzYwLRG-QBvYqPyXWzRzdasZtuVP5n25kZfyYjPXWhNwB8p69IHq9ROLGC586z5U7wkaeu5TXQH6o9URZHgpS/s1600/TFSSync2.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5CQb2VYnhWxeX2EPZ-aD4DP_M6M-HZpqM4n7HHdHCAcKFVCd7uQ7yfMdKzYwLRG-QBvYqPyXWzRzdasZtuVP5n25kZfyYjPXWhNwB8p69IHq9ROLGC586z5U7wkaeu5TXQH6o9URZHgpS/s1600/TFSSync2.png" height="65" width="320" /></a></div>
<span style="mso-ansi-language: EN-IN; mso-fareast-language: EN-IN; mso-no-proof: yes;"></span><br />
<span style="mso-ansi-language: EN-IN; mso-fareast-language: EN-IN; mso-no-proof: yes;"></span><br />
<span style="mso-ansi-language: EN-IN; mso-fareast-language: EN-IN; mso-no-proof: yes;"></span><br />
<span style="mso-ansi-language: EN-IN; mso-fareast-language: EN-IN; mso-no-proof: yes;"></span><br />
<span lang="EN-US"><o:p><span style="font-family: Calibri;"></span></o:p></span><br />
<span lang="EN-US"><span style="font-family: Calibri;">It shows two entries (record) for
DirPartyPostalAddressView in the searched result. Here system has two entries
for DirPartyPostalAddressView so during TFS synchronization it tries to create
two entries to table SysVersionControlTmpChange and this table does not allow
more than one entry for the same object. During 2<sup><span style="font-size: x-small;">nd</span></sup> entry for DirPartyPostalAddressView
to SysVersionControlTmpChange, system throws error “The record already exists.”</span></span><br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;">
<span lang="EN-US"><span style="font-family: Calibri;">Now I have the visibility to which object the problem
is associated with. So I opened the AOT and went to view
DirPartyPostalAddressView, compiled it and synchronized it with TFS. On
synchronization it throws same error. Then I started looking to the
customization done for this objects and came out with a conclusion that some
incorrect customization was there. I fixed it and it was working perfectly.</span></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;">
<span lang="EN-US"><span style="font-family: Calibri;">Hope this piece of information will be useful for you.</span></span></div>
<span lang="EN-US" style="font-family: "Calibri","sans-serif"; font-size: 11pt; line-height: 115%; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">You may write your comments below.</span></div>
Rajesh Biswashttp://www.blogger.com/profile/07514591087556132461noreply@blogger.com2tag:blogger.com,1999:blog-7893807248327172219.post-78410063509370940122014-02-25T21:55:00.001-08:002014-02-25T22:00:30.941-08:00How to resolve CIL problem when it says Cannot create a record in SysXppAssembly (SysXppAssembly). The record already exists. <div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Verdana, sans-serif;">How to resolve CIL problem when it says Cannot create a record in SysXppAssembly (SysXppAssembly). The record already exists.</span><br />
<span style="font-family: Verdana, sans-serif;"></span><br />
<span style="font-family: Verdana, sans-serif;">Sometimes you try to general incremental CIL or full CIL and receive error like "Cannot create a record in SysXppAssembly (SysXppAssembly). The record already exists." as shown below.</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdYlYNw7GNV9V5LOM6ifuEdOlzZxKH7BRUF2WyhS54ihC6oNk_Byu4JMxjr-vIZFhlQXoRxvUOerpPK7mOnGloZKV1lvpk_WfcHnfiiPEQKSsMrv1ZXsG-yz85uAQ4tdKQjWzb6NigklqN/s1600/SysXppAssemblyError.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdYlYNw7GNV9V5LOM6ifuEdOlzZxKH7BRUF2WyhS54ihC6oNk_Byu4JMxjr-vIZFhlQXoRxvUOerpPK7mOnGloZKV1lvpk_WfcHnfiiPEQKSsMrv1ZXsG-yz85uAQ4tdKQjWzb6NigklqN/s1600/SysXppAssemblyError.jpg" height="320" width="260" /></a></div>
<br />
<br />
<span style="font-family: Verdana, sans-serif;">How to get out of this error?</span><br />
<span style="font-family: Verdana, sans-serif;"></span><br />
<span style="font-family: Verdana, sans-serif;">The solution is simple. You need to restart the AOS.</span><br />
<span style="font-family: Verdana, sans-serif;"></span><br />
<span style="font-family: Verdana, sans-serif;"><span style="color: #cc0000;"><span style="color: #cc0000;"><b>Applied on</b></span></span><span style="color: #333333;"><span style="color: #333333;">: Dynamics AX 2012
R2</span></span><br /><span style="color: #cc0000;"><span style="color: #cc0000;"><b>Prerequisite</b></span></span><span style="color: #333333;"><span style="color: #333333;">: Basic Dynamics AX 2012
knowledge</span></span></span><br />
<span style="font-family: Verdana, sans-serif;"><span style="color: #333333; font-family: Arial;"><span style="color: #333333; font-family: Arial;"><span style="color: #333333; font-family: Arial;">
</span></span></span><b><span style="color: #cc0000;"><span style="color: #cc0000;">Target audience</span></span></b><span style="color: #333333;"><span style="color: #333333;">: AX programmers</span></span></span><span style="color: #333333; font-family: Arial;"><span style="color: #333333; font-family: Arial;"><span style="color: #333333; font-family: Arial;"><br /></span></span></span><span style="font-family: Verdana, sans-serif;"><b><span style="color: #cc0000;"><span style="color: #cc0000;">Assumption</span></span></b><span style="color: #333333;"><span style="color: #333333;">: You are familiar with Dynamics AX
2012</span></span></span><br />
<span style="font-family: Verdana, sans-serif;"></span><br />
<span style="font-family: Verdana, sans-serif;">Hope this was useful. You may leave your comments below.</span><br />
<br />
<br />
<br />
</div>
Rajesh Biswashttp://www.blogger.com/profile/07514591087556132461noreply@blogger.com0tag:blogger.com,1999:blog-7893807248327172219.post-34553207185605419962014-02-21T03:56:00.001-08:002014-02-21T03:56:47.529-08:00How to resolve error Disconnected from the AOS for Microsoft Dynamics AX 2012 and Visual Studio .Net<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: small;">Why you get error "Disconnected from the AOS" when you open Visual Studio and try to see Application Explorer tool box to customize something for Microsoft Dynamics AX Enterprise Portal or SSRS Reports?<br />
</span><span style="font-family: Calibri; font-size: small;"><span style="font-family: Calibri; font-size: small;"><span lang=""><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjt2vLLvSj3PyPZqzXpHrlDM4_3nnof11q4Czgktgpq_ycDXg5TStyS8tCfjxkp6-rD3yjDh_IF067a9SHpDd6upOy8ZtUf7zLP2sAh7JBRtJ6P9d5ZyVAnKT7mp3xR8581gLupdVs1P6SC/s1600/AOTConnectError.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjt2vLLvSj3PyPZqzXpHrlDM4_3nnof11q4Czgktgpq_ycDXg5TStyS8tCfjxkp6-rD3yjDh_IF067a9SHpDd6upOy8ZtUf7zLP2sAh7JBRtJ6P9d5ZyVAnKT7mp3xR8581gLupdVs1P6SC/s1600/AOTConnectError.jpg" /></a></div>
</span><br /></span><br /></span><span style="font-size: small;"><span lang="EN">Reason: <br />
<br />
The Visual Studio instance you open does not refer the configuration which is configured. Such error you will encounter when you have different client and AOS system. For example; Server 1 is having Application Object Server (AOS) and System 1 is having AX client so you have AX client and server on different machines. Other way your Visual Studio instance is not connected to target Microsoft Dynamics AX AOS configuration.<br />
</span><br /></span><b><span style="color: #cc0000; font-size: small;"><span style="color: #cc0000; font-size: small;"></span></span></b><span style="color: #cc0000; font-size: small;"><span style="color: #cc0000; font-size: small;"></span></span><span style="color: #cc0000; font-size: small;"><span style="color: #cc0000; font-size: small;"><b>Applied on</b></span></span><span style="color: #333333; font-size: small;"><span style="color: #333333; font-size: small;">: Dynamics AX 2012 R2</span></span><br />
<span style="color: #333333; font-size: small;"><span style="color: #333333; font-size: small;">
</span></span><b><span style="color: #cc0000; font-size: small;"><span style="color: #cc0000; font-size: small;"></span></span></b><span style="color: #cc0000; font-size: small;"><span style="color: #cc0000; font-size: small;"></span></span><br />
<span style="color: #cc0000; font-size: small;"><span style="color: #cc0000; font-size: small;"><b>Prerequisite</b></span></span><span style="color: #333333; font-size: small;"><span style="color: #333333; font-size: small;">: Basic Dynamics AX 2012 knowledge</span></span><span style="color: #333333; font-family: Arial; font-size: small;"><span style="color: #333333; font-family: Arial; font-size: small;"><span style="color: #333333; font-family: Arial; font-size: small;"> <br />
</span></span></span><b><span style="color: #cc0000; font-size: small;"><span style="color: #cc0000; font-size: small;">Target audience</span></span></b><span style="color: #333333; font-size: small;"><span style="color: #333333; font-size: small;">: AX programmers</span></span><span style="color: #333333; font-family: Arial; font-size: small;"><span style="color: #333333; font-family: Arial; font-size: small;"><span style="color: #333333; font-family: Arial; font-size: small;"><br />
</span></span></span><b><span style="color: #cc0000; font-size: small;"><span style="color: #cc0000; font-size: small;">Assumption</span></span></b><span style="color: #333333; font-size: small;"><span style="color: #333333; font-size: small;">: You are familiar with Dynamics AX 2012 and Visual Studio .Net</span></span><br />
<span style="color: #333333; font-size: small;"><span style="color: #333333; font-size: small;">
</span></span><br />
<span style="font-size: small;">
<br />
Solution: <br />
</span><b><span style="color: #cc0000; font-size: small;"><span style="color: #cc0000; font-size: small;"></span></span></b><span style="color: #cc0000; font-size: small;"><span style="color: #cc0000; font-size: small;"></span></span><span style="color: #cc0000; font-size: small;"><span style="color: #cc0000; font-size: small;"><b>Option 1:</b></span></span><span style="font-size: small;"> You should have AX client and server on the same machine. In general development server with multi users is not configured with single machine based.</span><br />
<span style="font-size: small;">
</span><b><span style="color: #cc0000; font-size: small;"><span style="color: #cc0000; font-size: small;"></span></span></b><span style="color: #cc0000; font-size: small;"><span style="color: #cc0000; font-size: small;"></span></span><br />
<span style="color: #cc0000; font-size: small;"><span style="color: #cc0000; font-size: small;"><b>Option 2:</b></span></span><span style="font-size: small;"> If your AX client and server are on different machines, you need to launch your Visual Studio instance using a shortcut from AX client machine and that shortcut should have target AOS configuration. E.g. You have an AX configuration file called VAR_DEV.AXC to launch the correct AOS. Get a shortcut of your Visual Studio on AX client machine right click on it. You will see the property dialog as shown below.</span><br />
<span style="font-size: small;">
</span><br />
<span style="font-family: Calibri; font-size: small;"><br />
<span style="font-family: Calibri; font-size: small;"><div class="separator" style="clear: both; text-align: center;">
<img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTtL7scKDW4MAQ0rkKIJF0UtcwNBcT1weNVM1ANUpy5diVpBeOA6ikcAYn-crQPOXS0Z6Et1xIN-9aihXeztRjmaQpyrllWunQk3gPKrn3P0CP4eIYW7kyfEQMW0HRWpxB62fOQfHbLcWF/s1600/AOTConnectError1.jpg" height="320" width="225" /></div>
</span><div class="separator" style="clear: both; text-align: center;">
</div>
</span><span style="font-size: small;"><span lang="EN"><br />
You will see the Visual Studio instance common IDE path [see above]. This is the default path. The depends based on installation.<br />
<br />
The Target field should have path "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe". This is the default path. <br />
</span><br /></span><span style="font-size: small;">The action you need to perform is to add target for AOS configuration file to it. To achieve this replace the path with "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" /AXConfig </span><span style="font-size: small;"><span lang="EN">\\[File location]\DEV04_VAR.AXC</span></span><br />
<br />
<span style="font-size: small;">
<br />
After modifying this value click on Apply button. Now you launch your Visual Studio by double clicking this Visual Studio Icon. It will allow you to see AOT objects as shown below.<br />
</span><span style="font-family: Calibri; font-size: small;"><span style="font-family: Calibri; font-size: small;"><span lang=""><div class="separator" style="clear: both; text-align: center;">
<img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPduo4PiysEm-Areot-XlFClG0pXhqsHehlZtsO2AVCXWRguDqfH1vAVC8YdUv5hMLHLH08vvaHMFnZAUW5Tn6-f1OuCh09efVmHs_BOdLB-iFaurEJ-hTrJSBcFhX4O_f9AdFysupJbvR/s1600/AOTConnectError2.jpg" height="320" width="168" /></div>
</span> </span> </span><br />
<span style="color: #cc0000; font-size: small;"><span style="color: #cc0000; font-size: small;"></span></span><br />
<span style="color: #cc0000; font-size: small;"><span style="color: #cc0000; font-size: small;"><b>Option 3:</b></span></span><span style="font-size: small;"> On AX client machine configuration utility you can upload configuration file DEV04_VAR.AXC. To do this, open Microsoft Dynamics AX 2012 Configuration Utility from Administrative Tools. Click on Manage button then Set Configuration Stone.</span><br />
<span style="font-size: small;">
</span><br />
<span style="font-family: Calibri; font-size: small;"><div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL7B_BBkALWT__gNc7cdGIOMquwDj0MU7kks9vCSMpJgfM2lQnNMU2czieT68PEnrdDfLXtgYccnebV-shZ70YfgjA5t0TBe-zupHecBGe2SpyIxQ-TEwUlpT1OQG0mSHwMSEhMSd6tpY8/s1600/AOTConnectError4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL7B_BBkALWT__gNc7cdGIOMquwDj0MU7kks9vCSMpJgfM2lQnNMU2czieT68PEnrdDfLXtgYccnebV-shZ70YfgjA5t0TBe-zupHecBGe2SpyIxQ-TEwUlpT1OQG0mSHwMSEhMSd6tpY8/s1600/AOTConnectError4.jpg" height="195" width="320" /></a></div>
<br /></span><span style="font-size: small;"><span lang="EN"><br />
Click on Apply button then OK.<br />
<br />
Now you can launch your Visual Studio on AX client machine from Start button > All Programs > Microsoft Visual Studio 2010 folder > Microsoft Visual Studio 2010.<br />
<br />
</span><div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1qRYb2vopJmrrIj-q3VGhTwVQdgCpaexjI3l6Jn3Mb3sbU4RRU6mjUGIkQ56-2ykJdmaIehu5yhTAeJ4SNhyKfYEedFQ10sqyxSZ6XEwjh4SQije4QiyoN5t6c-TlIBdYuIf2ZyowEm3b/s1600/AOTConnectError3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1qRYb2vopJmrrIj-q3VGhTwVQdgCpaexjI3l6Jn3Mb3sbU4RRU6mjUGIkQ56-2ykJdmaIehu5yhTAeJ4SNhyKfYEedFQ10sqyxSZ6XEwjh4SQije4QiyoN5t6c-TlIBdYuIf2ZyowEm3b/s1600/AOTConnectError3.jpg" /></a></div>
<br /></span><span style="font-size: small;"><span lang="EN"><br />
Hope this was useful for you. You may leave your comments below.<br />
<br />
</span></span></div>
Rajesh Biswashttp://www.blogger.com/profile/07514591087556132461noreply@blogger.com3tag:blogger.com,1999:blog-7893807248327172219.post-83514888791562987992014-02-19T08:48:00.001-08:002014-02-19T08:48:47.919-08:00How to call an AIF Service operation and send data outside Microsoft Dynamics AX 2012 using X++ code<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">Sometimes it happens like you developed an AIF Service in
Microsoft Dynamics AX and not able to test. Reason can be anything. Consider a
scenario where you need to send AX data outside using standard AIF services but
don’t know how to send.<o:p></o:p></span></div>
<span style="font-family: Calibri;">This article explains you how to run a read operation for an
AIF Service to send data from Microsoft Dynamics AX to your destination folder
using File System Adapter. This article may answer below questions:<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">Using X++ codes how to call a service operation for
Microsoft Dynamics AX 2012 AIF?</span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">How to call or execute read operation in Microsoft Dynamics
AX 2012?<o:p></o:p></span></div>
<span style="font-family: Calibri;">How to send data outside Microsoft Dynamics AX 2012 using Outbound?
<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">How to use standard Microsoft Dynamics AX 2012 AIF Services?<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><span style="color: #cc0000;"><strong>Applied on</strong></span>: Dynamics AX 2012 R2<o:p></o:p></span></div>
<span style="font-family: Calibri;"><span style="color: #cc0000;"><strong>Prerequisite</strong></span>: X++; MorphX; Basic programming knowledge, Basic AIF<o:p></o:p></span><br />
<span style="font-family: Calibri;"><span style="color: #cc0000;"><strong>Target audience</strong></span>: AX programmers</span><br />
<span style="font-family: Calibri;"><span style="color: #cc0000;"><strong>Assumption</strong></span>: Outbound port is configured properly. The person has the
basic idea about AIF.<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Calibri;">Here I used a standard
service call VendVendTableService and read operation of it to send Vendor data
outside.<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Calibri;">Below job is to select a
vendor record and send to Queue Manager.<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<b><span style="color: darkblue; font-family: Consolas; font-size: 8pt;">static</span></b><span style="font-family: Consolas; font-size: 8pt;"> <b><span style="color: darkblue;">void</span></b>
aifOutBoundServiceCall(Args _args)<o:p></o:p></span></div>
<span style="font-family: Consolas; font-size: 8pt;">{<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>AxdSendContext<span style="mso-spacerun: yes;">
</span>axdSendContext<span style="mso-spacerun: yes;"> </span>=
AxdSendContext::construct();<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>AifEntityKey<span style="mso-spacerun: yes;">
</span>aifEntityKey<span style="mso-spacerun: yes;"> </span>=
AifEntityKey::construct();<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span>Map<span style="mso-spacerun: yes;"> </span>keyData;<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>AifConstraintList<span style="mso-spacerun: yes;">
</span>aifConstraintList<span style="mso-spacerun: yes;"> </span>= <b><span style="color: darkblue;">new</span></b> AifConstraintList();<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>AifConstraint<span style="mso-spacerun: yes;">
</span>aifConstraint<span style="mso-spacerun: yes;"> </span>= <b><span style="color: darkblue;">new</span></b> AifConstraint();<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span>VendTable<span style="mso-spacerun: yes;"> </span>vendTable;<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">select</span></b> <b><span style="color: darkblue;">firstOnly</span></b>
vendTable<o:p></o:p></span></div>
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">where</span></b> vendTable.AccountNum == <span style="color: darkred;">"</span></span><span style="color: darkred; font-family: "MS Mincho"; font-size: 8pt; mso-bidi-font-family: "MS Mincho";"></span><span style="color: darkred; font-family: Consolas; font-size: 8pt;">V-1001"</span><span style="font-family: Consolas; font-size: 8pt;">;<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span>keyData =
SysDictTable::getKeyData(vendTable);<o:p></o:p></span></div>
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>aifEntityKey.parmTableId(vendTable.TableId);<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>aifEntityKey.parmRecId(vendTable.RecId);<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>aifEntityKey.parmKeyDataMap(keyData);<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>axdSendContext.parmXMLDocPurpose(XMLDocPurpose::Original);<o:p></o:p></span></div>
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>axdSendContext.parmSecurity(<b><span style="color: darkblue;">false</span></b>);<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>aifConstraint.parmType(AifConstraintType::NoConstraint) ;<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>aifConstraintList.addConstraint(aifConstraint) ;<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 8pt;"></span><br /></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: #00b050; font-family: Consolas; font-size: 8pt;">//To handle an error it can be checked
if outbound port is configured. This is optional.<o:p></o:p></span></div>
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>AifSendService::submitDefault(<span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">classnum</span></b>(VendVendTableService),<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>aifEntityKey,<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>aifConstraintList,<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>AifSendMode::Async,<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>axdSendContext.pack());<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 8pt;">}<o:p></o:p></span></div>
<o:p><span style="font-family: Calibri;"> </span></o:p><br />
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">Below logic can be used to check whether Outbound port is
configure or not properly. It’s not mandatory but nice to have.<o:p></o:p></span></div>
<b><span style="color: darkblue; font-family: Consolas; font-size: 8pt;">boolean</span></b><span style="font-family: Consolas; font-size: 8pt;"> canSendXML()<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;">{<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">boolean</span></b><span style="mso-spacerun: yes;"> </span>ret;<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>AifActionId<span style="mso-spacerun: yes;"> </span>actionId;<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>AifEndpointList<span style="mso-spacerun: yes;"> </span>endpointList;<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>AifConstraint<span style="mso-spacerun: yes;"> </span>aifConstraint
= <b><span style="color: darkblue;">new</span></b> AifConstraint();<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>AifConstraintList<span style="mso-spacerun: yes;">
</span>aifConstraintList = <b><span style="color: darkblue;">new</span></b>
AifConstraintList();<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span>actionId
= AifSendService::getDefaultSendAction(<b><span style="color: darkblue;">classnum</span></b>(</span><span style="font-family: Calibri;">V</span><span style="font-family: Consolas; font-size: 8pt;">endVendTableService),
AifSendActionType::SendByKey);<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 8pt;"><o:p> </o:p></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">if</span></b> (actionId)<o:p></o:p></span></div>
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>aifConstraint.parmType(AifConstraintType::NoConstraint);<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>aifConstraintList.addConstraint(aifConstraint);<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><o:p> </o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>endpointList = AifSendService::getEligibleEndpoints(actionId,
aifConstraintList);<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><o:p> </o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">if</span></b> (endpointList.getEndpointCount()><b><span style="color: red;">0</span></b>)<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>ret = <b><span style="color: darkblue;">true</span></b>;<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span><br />
<br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">return</span></b> ret;<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;">}<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<span style="font-family: Calibri;">To release data from Queue Manager below job can be
executed.<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<b><span style="color: darkblue; font-family: Consolas; font-size: 8pt;">static</span></b><span style="font-family: Consolas; font-size: 8pt;"> <b><span style="color: darkblue;">void</span></b>
aifOutboundExecutoinJob()<o:p></o:p></span></div>
<span style="font-family: Consolas; font-size: 8pt;">{<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">new</span></b> AifOutboundProcessingService().run();<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">new</span></b> AifGatewaySendService().run();<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;">}<o:p></o:p></span><br />
<br />
<span style="font-family: Consolas; font-size: 8pt;"><o:p> </o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><o:p> </o:p></span><br />
<span style="font-family: "Calibri","sans-serif"; font-size: 11pt; line-height: 115%; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">After execution of above job below is the
output.</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCzTSBcQZytyEUl2pmJi-sCvTGjBcXYrV2WrkvQoJW3irZ1iYseSaBWXY0Nlrx-Q3jtZpOVPGIPXM-D7d9akOiBlejjUppmq-9HNOsh1yldoo3BfDWmNVI9w9uVDOh44rEVg0lUVzSh6TO/s1600/Image4.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCzTSBcQZytyEUl2pmJi-sCvTGjBcXYrV2WrkvQoJW3irZ1iYseSaBWXY0Nlrx-Q3jtZpOVPGIPXM-D7d9akOiBlejjUppmq-9HNOsh1yldoo3BfDWmNVI9w9uVDOh44rEVg0lUVzSh6TO/s1600/Image4.jpg" height="141" width="400" /></a></div>
<span style="font-family: "Calibri","sans-serif"; font-size: 11pt; line-height: 115%; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"></span> </div>
Rajesh Biswashttp://www.blogger.com/profile/07514591087556132461noreply@blogger.com0tag:blogger.com,1999:blog-7893807248327172219.post-43493478726618889162014-02-19T03:33:00.001-08:002014-02-19T03:34:49.601-08:00In Microsoft Dynamics AX, how to get a look up of all the tables available in AOT<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">This article explains you how to get a look up to a control for All the
AOT tables and can answer to below relevant questions.<o:p></o:p></span></div>
<span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span style="font-family: Calibri;">Create a look up to show all the tables from AOT.<o:p></o:p></span><br />
<span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span style="font-family: Calibri;">How to develop a drop down to show all the AOT
tables where user can select one among?<o:p></o:p></span><br />
<span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span style="font-family: Calibri;">How to create an edit method in Microsoft
Dynamics AX?<o:p></o:p></span><br />
<br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">Applied on: Dynamics AX 2012 R2<o:p></o:p>
<br />
Prerequisite: X++; MorphX; Basic programming knowledge<o:p></o:p>
<br />
Target audience: Any
</span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: Calibri;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOL6i0tD7E-vXlfYSy7Df7MZdyQN2tddGtlsN3Opm33cvsTqJOXdKknsruhQhSGgKrBAwtjRIAfJ12eI7TznWtXL1DVefBgIudfH1-MjNDxURyDc6aJy9N2gCnWPTKQelfCV_El4b3xpch/s1600/Image1.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOL6i0tD7E-vXlfYSy7Df7MZdyQN2tddGtlsN3Opm33cvsTqJOXdKknsruhQhSGgKrBAwtjRIAfJ12eI7TznWtXL1DVefBgIudfH1-MjNDxURyDc6aJy9N2gCnWPTKQelfCV_El4b3xpch/s1600/Image1.jpg" height="285" width="320" /></a></span></div>
<span style="font-family: Calibri;"> </span><br />
<span style="font-family: Calibri;"> </span><br />
<br /></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="mso-no-proof: yes;"><v:shapetype coordsize="21600,21600" filled="f" id="_x0000_t75" o:preferrelative="t" o:spt="75" path="m@4@5l@4@11@9@11@9@5xe" stroked="f">
<v:stroke joinstyle="miter">
<v:formulas>
</v:formulas>
<v:path gradientshapeok="t" o:connecttype="rect" o:extrusionok="f">
<o:lock aspectratio="t" v:ext="edit">
</o:lock></v:path></v:stroke></v:shapetype><v:shape id="Picture_x0020_6" o:spid="_x0000_i1027" style="height: 269.25pt; mso-wrap-style: square; visibility: visible; width: 301.5pt;" type="#_x0000_t75">
<v:imagedata o:title="" src="file:///C:\Users\RAJESH~1.BIS\AppData\Local\Temp\msohtmlclip1\01\clip_image001.png">
</v:imagedata></v:shape></span><o:p></o:p></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"></span><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<span style="font-family: Calibri;">Output: Look up of all the AOT tables</span><br />
<span style="font-family: Calibri;"></span> </div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">Create a table with a single field. Here my table name is TableLookUp
with field name TableObjID.<o:p></o:p><br />
<span style="font-family: Calibri;">The field should be extended to RefTableId EDT as shown below.<o:p></o:p></span>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgj1wBOmvyB1w4eLtcYjfPMhM0gZNdgGTz11g0fYXEpDg0q8oMS8F7IEhskA7As2qh6lBFnAfVjZVB8MPbaP4V420hhWLl_WQKMZojUBZTbJULlUAoMWf4peI6HL-FTKFPLvMpWuk0HdXIM/s1600/Image2.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgj1wBOmvyB1w4eLtcYjfPMhM0gZNdgGTz11g0fYXEpDg0q8oMS8F7IEhskA7As2qh6lBFnAfVjZVB8MPbaP4V420hhWLl_WQKMZojUBZTbJULlUAoMWf4peI6HL-FTKFPLvMpWuk0HdXIM/s1600/Image2.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgj1wBOmvyB1w4eLtcYjfPMhM0gZNdgGTz11g0fYXEpDg0q8oMS8F7IEhskA7As2qh6lBFnAfVjZVB8MPbaP4V420hhWLl_WQKMZojUBZTbJULlUAoMWf4peI6HL-FTKFPLvMpWuk0HdXIM/s1600/Image2.jpg" height="341" width="400" /></a>
</span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<a href="https://www.blogger.com/" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"></a><a href="https://www.blogger.com/" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"></a><a href="https://www.blogger.com/" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"></a><a href="https://www.blogger.com/" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"></a><a href="https://www.blogger.com/" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"></a><a href="https://www.blogger.com/" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"></a><span style="mso-no-proof: yes;"><v:shape id="Picture_x0020_3" o:spid="_x0000_i1026" style="height: 393.75pt; mso-wrap-style: square; visibility: visible; width: 458.25pt;" type="#_x0000_t75">
</v:shape></span></div>
<br />
<span style="font-family: Calibri;">Write an edit method to your table. I wrote a method in the name of tableObject2Name.
The method looks like:</span><br />
<br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<i><span style="color: green; font-family: Consolas; font-size: 8pt;">// This
method returns table name</span></i><o:p></o:p></div>
<i><span style="color: green; font-family: Consolas; font-size: 8pt;">// BP deviation
documented</span></i><span style="font-family: Consolas; font-size: 8pt;"><o:p></o:p></span><br />
<b><span style="color: darkblue; font-family: Consolas; font-size: 8pt;">edit</span></b><span style="font-family: Consolas; font-size: 8pt;"> TableName tableObject2Name(<b><span style="color: darkblue;">boolean</span></b> _set, TableName _name) <i><span style="color: green;">// System Documentation>Type>TableName</span></i><o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;">{<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>Dictionary<span style="mso-spacerun: yes;"> </span>dictionary;<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>TableId<span style="mso-spacerun: yes;"> </span>tableID;<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">if</span></b> (_set)<o:p></o:p></span></div>
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>dictionary = <b><span style="color: darkblue;">new</span></b>
Dictionary();<span style="mso-spacerun: yes;"> </span><i><span style="color: green;">// System Documentation>Classes>Dictionary</span></i><o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>tableID = dictionary.<b><span style="color: darkblue;">tableName2Id</span></b>(_name);<o:p></o:p></span><br />
<a href="https://www.blogger.com/" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><a href="https://www.blogger.com/" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><a href="https://www.blogger.com/" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">if</span></b> (tableID)<o:p></o:p></span></div>
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>this.TableObjID = tableID;<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span><b><span style="color: darkblue;">return</span></b> <b><span style="color: darkblue;">tableid2name</span></b>(this.TableObjID);<o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;">}<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">Create a new form and use the table you created as data sources and
method to get a control.<o:p></o:p></span></div>
<span style="font-family: Calibri;">Here my form looks like:<o:p></o:p></span><br />
<o:p><span style="font-family: Calibri;"> </span></o:p><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIUn0q-Hus6HJbyonpOI_vUvmlPdj9GbPcdH11MbpXyZD43sNI5TyzobsVMXRxQkZxkjw7xnG_qFtNU009dNtzjJ3rgP44gfZwAFSOYxt6QnxK16FJE3k_xWpcjyOW3bqki5dt88fC3QVX/s1600/Image3.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIUn0q-Hus6HJbyonpOI_vUvmlPdj9GbPcdH11MbpXyZD43sNI5TyzobsVMXRxQkZxkjw7xnG_qFtNU009dNtzjJ3rgP44gfZwAFSOYxt6QnxK16FJE3k_xWpcjyOW3bqki5dt88fC3QVX/s1600/Image3.jpg" height="130" width="400" /></a><br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="mso-no-proof: yes;"><><v:shape id="Picture_x0020_7" o:spid="_x0000_i1025" style="height: 164.25pt; mso-wrap-style: square; visibility: visible; width: 501.75pt;" type="#_x0000_t75">
</v:shape></span><br />
<br />
<br /></div>
</div>
Rajesh Biswashttp://www.blogger.com/profile/07514591087556132461noreply@blogger.com0tag:blogger.com,1999:blog-7893807248327172219.post-70993492884473162692012-10-29T11:43:00.000-07:002012-10-29T11:53:42.048-07:00How to fix Best Practice error The Table.Field does not have a corresponding parm-method on the AxBC-class<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">How to fix Best Practice error The Table.Field does not have
a corresponding parm-method on the AxBC-class</span></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<strong><span style="color: #990000; font-family: "Verdana","sans-serif"; font-size: 10pt; line-height: 115%; mso-bidi-font-family: Arial;">Applied
on:</span></strong><span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 11.5pt; line-height: 115%;"><br />
</span><span style="color: #333333; font-family: "Verdana","sans-serif"; font-size: 10pt; line-height: 115%; mso-bidi-font-family: Arial;">Microsoft Dynamics<sup>®</sup> AX
2012 Fpk.</span><span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 11.5pt; line-height: 115%;"><br />
<br />
</span><strong><span style="color: #990000; font-family: "Verdana","sans-serif"; font-size: 10pt; line-height: 115%; mso-bidi-font-family: Arial;">Assumption:</span></strong><span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 11.5pt; line-height: 115%;"><br />
</span><span style="color: #333333; font-family: "Verdana","sans-serif"; font-size: 10pt; line-height: 115%; mso-bidi-font-family: Arial;">This article is for those who has at
least basic and programming</span><span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 11.5pt; line-height: 115%;"><br />
</span><span style="color: #333333; font-family: "Verdana","sans-serif"; font-size: 10pt; line-height: 115%; mso-bidi-font-family: Arial;">knowledge of Dynamics<sup>®</sup> AX.</span><span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 11.5pt; line-height: 115%;"><br />
<br />
</span><strong><span style="color: #990000; font-family: "Verdana","sans-serif"; font-size: 10pt; line-height: 115%; mso-bidi-font-family: Arial;">About this article:</span></strong><span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 11.5pt; line-height: 115%;"><br />
</span><span style="color: #333333; font-family: "Verdana","sans-serif"; font-size: 10pt; line-height: 115%; mso-bidi-font-family: Arial;">how to fix </span><span style="font-family: Calibri;">Best Practice error
The Table.Field does not have a corresponding parm-method on the AxBC-class</span><span style="color: #333333; font-family: "Verdana","sans-serif"; font-size: 10pt; line-height: 115%; mso-bidi-font-family: Arial;"> <span style="mso-spacerun: yes;"> </span>when you create new field for existing table. E.g.
InventTable, PurchTable, SalesTable etc.</span><br />
<span style="color: #333333; font-family: "Verdana","sans-serif"; font-size: 10pt; line-height: 115%; mso-bidi-font-family: Arial;">BP Deviation for <span style="color: black; font-family: Calibri; font-size: small;">The Table.Field does not have a corresponding parm-method on the AxBC-class due to new field creation for tables.</span> <o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="color: #333333; font-family: "Verdana","sans-serif"; font-size: 10pt; line-height: 115%; mso-bidi-font-family: Arial;">There are
number of ways to achieve this. As per my view the easiest way is to execute a
job. A sample job is mentioned below.<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<b><span style="color: darkblue; font-family: Consolas; font-size: 8pt;">static</span></b><span style="font-family: Consolas; font-size: 8pt;"> <b><span style="color: darkblue;">void</span></b>
CreateAxBCParmMethod(Args _args) <o:p></o:p></span></div>
<span style="font-family: Consolas; font-size: 8pt;">{ <o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>axGenerateAxBCClass axGenerateAxBCClass; <o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>axGenerateAxBCClass = AxGenerateAxBCClass::newTableId(<b><span style="color: darkblue;">tablenum</span></b>(InventTable)); <o:p></o:p></span></div>
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;">
</span>axGenerateAxBCClass.run(); <o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 8pt;"><span style="mso-spacerun: yes;"> </span></span><br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 8pt;">} <o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="color: #333333; font-family: "Verdana","sans-serif"; font-size: 10pt; line-height: 115%; mso-bidi-font-family: Arial;">In the above
job you can replace the table name instead of InventTable to create parm method as per your requirement.<o:p></o:p></span></div>
<span style="color: #333333; font-family: "Verdana","sans-serif"; font-size: 10pt; line-height: 115%; mso-bidi-font-family: Arial;">The above job
will generate method against new field created for InventTable.<o:p></o:p></span><br />
<span style="color: #333333; font-family: "Verdana","sans-serif"; font-size: 10pt; line-height: 115%; mso-bidi-font-family: Arial;">Hope this
article is useful.<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
</div>
Rajesh Biswashttp://www.blogger.com/profile/07514591087556132461noreply@blogger.com0tag:blogger.com,1999:blog-7893807248327172219.post-33118153750886280712012-06-14T05:39:00.001-07:002012-06-14T05:58:31.241-07:00How to use Windows File Path Dialog in Microsoft Dynamics® AX 2012<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="color: #0b5394; font-family: Verdana, sans-serif;"><strong>How to use Windows File Path Dialog in Microsoft Dynamics® AX 2012</strong></span><br />
<span style="font-family: Verdana, sans-serif; font-size: x-small;"></span><br />
<span style="font-family: Verdana, sans-serif;"><span style="font-size: x-small;"></span></span><br />
<span style="color: #990000; font-family: Verdana, sans-serif; font-size: x-small;"><strong>Applied on:</strong></span><br />
<span style="font-family: Verdana, sans-serif; font-size: x-small;">Microsoft Dynamics® AX 2012 CU2.</span><br />
<span style="font-family: Verdana, sans-serif;"><span style="font-size: x-small;"></span></span><br />
<span style="color: #990000; font-family: Verdana, sans-serif; font-size: x-small;"><strong>Assumption:</strong></span><br />
<span style="font-family: Verdana, sans-serif; font-size: x-small;">This article is for those who has at least basic data flow, navigation and programming</span><br />
<span style="font-family: Verdana, sans-serif; font-size: x-small;">knowledge of Dynamics® AX.</span><br />
<br />
<span style="color: #990000; font-family: Verdana, sans-serif; font-size: x-small;"><strong>About this article:</strong></span><br />
<span style="font-family: Verdana, sans-serif; font-size: x-small;">This article may answers your question like-</span><br />
<span style="font-family: Verdana, sans-serif; font-size: x-small;">In Microsoft Dynamics® AX 2012 how to call Windows File Path Dialog? </span><br />
<span style="font-family: Verdana, sans-serif; font-size: x-small;">How to use Windows File Path Dialog in X++ language?</span><br />
<span style="font-family: Verdana, sans-serif; font-size: x-small;">How to call WinAPI from Dynamics AX using X++ language?</span><br />
<span style="font-family: Verdana, sans-serif; font-size: x-small;">How to take file path input from user?</span><br />
<span style="font-family: Verdana, sans-serif;"><br /><span style="font-size: x-small;"></span></span><br />
<span style="font-family: Verdana, sans-serif; font-size: x-small;">I have written a job mentioned below which shows how to use Windows File Path Dialog with New Folder button option.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /><span style="font-size: x-small;"></span></span><br />
<span style="font-family: "Courier New", Courier, monospace; font-size: x-small;"><span style="color: blue;">static void</span> CallWinFilePathDialog(Args _args)</span><br />
<span style="font-family: "Courier New", Courier, monospace; font-size: x-small;">{</span><br />
<span style="font-family: "Courier New", Courier, monospace; font-size: x-small;"> FilePath filepath; <span style="color: lime;">// To hold path value</span></span><br />
<span style="font-family: "Courier New", Courier, monospace; font-size: x-small;"> filepath = WinAPI::browseForFolderDialog("Description goes here", "Selected path goes here", true);</span><br />
<span style="font-family: "Courier New", Courier, monospace; font-size: x-small;"> info(FilePath); <span style="color: lime;">// To Display</span> </span><br />
<span style="color: lime; font-family: "Courier New", Courier, monospace; font-size: x-small;"> // Here you can use your TableName.FieldName = filepath to store the value.</span><br />
<span style="font-family: "Courier New", Courier, monospace; font-size: x-small;">}</span><br />
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><br />The above code execution displays below dialog:</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHnn-3sA_ctSSr0C5LXwM1slYWySlNlRGvC6rvQQDC6Jv3EAiyByY7r6fG_ZvD70exhIzE3Hb01E8GK-pOaeMyjDq9ZfepHRbInkJn0SiOdaxLhkhABF7h6wi5pDYTbaeKWeEl-QwT_zRN/s1600/FilePathDialog.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="272" pca="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHnn-3sA_ctSSr0C5LXwM1slYWySlNlRGvC6rvQQDC6Jv3EAiyByY7r6fG_ZvD70exhIzE3Hb01E8GK-pOaeMyjDq9ZfepHRbInkJn0SiOdaxLhkhABF7h6wi5pDYTbaeKWeEl-QwT_zRN/s320/FilePathDialog.png" width="320" /></a></div>
<br />
<span style="font-family: Verdana, sans-serif; font-size: x-small;">You can create a button called Browse and implement above code to its clicked method.</span></div>Rajesh Biswashttp://www.blogger.com/profile/07514591087556132461noreply@blogger.com3tag:blogger.com,1999:blog-7893807248327172219.post-26519889587251343792012-05-27T05:02:00.001-07:002012-05-27T08:00:17.469-07:00How to use Event Handler in Microsoft Dynamics AX 2012<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><strong><span style="color: blue;">How to use Event Handler in Microsoft Dynamics AX 2012</span></strong> <br /><br /><span style="color: #cc0000;"><strong>Applied on:</strong></span><br />Microsoft Dynamics AX 2012 CU2.<br /><br /><strong><span style="color: #cc0000;">Assumption:</span></strong><br />This article is for those who has at least basic data flow, navigation and programming <br />knowledge of Dynamics AX.<br /><br /><strong><span style="color: #cc0000;">About this article:</span></strong><br />This article may answers your question like:-<br /><br />• In Microsoft Dynamics AX 2012 how to handle event on different methods / occurrences.<br /><br />• In Microsoft Dynamics AX 2012 how to implement or apply pre or post event handler.<br /><br />• How to develop an event handler step by step in Microsoft Dynamics AX 2012.<br /><br />• What is new in Microsoft Dynamics AX 2012 from programming point of view.</span><br />
<br />
<span style="font-family: Verdana, sans-serif; font-size: x-small;">• X++ Event handling in Dynamics AX 2012.</span><br />
<br />
<br /><br />Microsoft incorporated lot of beautiful new features in Dynamics AX 2012 and one of them is Event Handler. It’s a very nice feature of Dynamics AX 2012 which allows you trigger an event after or before an activity.<br /><br /><strong>There are different programming paradigms like:</strong><br /><strong>Observation</strong>: Where based on a particular behavior occurrence events can be used. For example if a new customer is created, based on this you need to update a table record and intimate to user.<br /><br /><strong>Information dissemination</strong>: This is related to trigger an event at right time, right information to get expected result.<br /><br /><strong>Decoupling</strong>: One producer's event can be acted upon by any number of consumers. Consumers can act upon any number of events from many different producers.<br /><br /><br />You should locate natural customization points and use events to publish the relevant information to subscribers. <br /><br />You should invoke / defining events over using pre or post events on methods.<br /><br />Pre-Event Handlers and Post-Event Handlers<br /><br />An event handler can reside underneath a method node can run either before or after the method runs. You can use CalledWhen property on the event handler node. The CalledWhen property has two values: <br /><br />• Pre – The event handler runs before the method starts. <br />• Post – The event handler runs after the method ends. <br /><br />A new class the XppPrePostArgs Parameter is being used by event handlers.<br /><br />A pre-method event handler that has only an XppPrePostArgs parameter can inspect and change the values of the parameters. <br /><br />Similarly a post-method event handler that has only an XppPrePostArgs parameter can inspect and change the return value from the method. <br /><br /><br />When an XppPrePostArgs object is used, the values of the parameters and the return type can be changed by the event handler. The values can be changed even if the parameters and return type are value types, such as an integer or string. If a parameter or a return type is a reference to an object, the event handler can call methods on the object and could change the state of the object. <br /><br /><br />Event handlers can run only on the same tier as the publisher class of the delegate runs on. For instance, if the publisher class has its RunOn property set to Server, to declare a method with client keyword and call a subscribed event handler method is not allowed.<br /><br />You can use X++ event as well as .Net made managed code event. You can define it at Event handler proper called EventHandlerType.<br /><br /><br /><strong>How to use event handlers in Microsoft Dynamics AX 2012 step by step:</strong><br /><br />1) Open your new developer work space and go to AOT then classes node.<br /><br />2) Right click on Classes node and click on New Class as shown below. <br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrHLrHY6ZeM91iqJkg2VOE2_NIolFCAwoUVCsRCLs42dFLfzs3100ksxAoENCqCCKYty-2Ve2B0zClaGI4WS1bHDfbCQ69NKiPO8L3sDCLrEmDU7PvWd7AOKDtlOTo-DW7v8m0sDYwOmQr/s1600/event1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" qba="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrHLrHY6ZeM91iqJkg2VOE2_NIolFCAwoUVCsRCLs42dFLfzs3100ksxAoENCqCCKYty-2Ve2B0zClaGI4WS1bHDfbCQ69NKiPO8L3sDCLrEmDU7PvWd7AOKDtlOTo-DW7v8m0sDYwOmQr/s1600/event1.png" /></a></div>
<br />
<br />
3) By default system will give a name to it. Here in my case it’s Class1. Right click on newly created class and click on Rename shown below.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqzpOy8hoWKBWlX_0K7AuBZS78p1Bb8D0-SSQyV9lkQdVaqpfmz8gjh_jTlL76ITgRgMzEzCv-wgd9kvHiaAiOleTlAeucS4XACv_arp-j6KePOVXrJ_e5Y1QP2SgbhZJqh0IAnvx49yOn/s1600/event2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" qba="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqzpOy8hoWKBWlX_0K7AuBZS78p1Bb8D0-SSQyV9lkQdVaqpfmz8gjh_jTlL76ITgRgMzEzCv-wgd9kvHiaAiOleTlAeucS4XACv_arp-j6KePOVXrJ_e5Y1QP2SgbhZJqh0IAnvx49yOn/s320/event2.png" width="261" /></a></div>
<br />
<br />
4) After clicking Rename, give a name called CustTableEventHandler to it. Here I am going to develop an event to be applied on CustTable so that is the reason why I decided this name (CustTableEventHandler). After renaming this class, it looks as shown below.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8ykJiOyhs6LE4pnGbYQQMLjGxvk-QT0_kckDFK_qOSq1A7FBh2_s56c_aWaO2UBSVuUdubwWWM78TihYIdw-oTl32uSZWrbEGfuychen3ouS_3Z5GZpl2URYQ-PwlOkxbLKBwnifM06va/s1600/event3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" qba="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8ykJiOyhs6LE4pnGbYQQMLjGxvk-QT0_kckDFK_qOSq1A7FBh2_s56c_aWaO2UBSVuUdubwWWM78TihYIdw-oTl32uSZWrbEGfuychen3ouS_3Z5GZpl2URYQ-PwlOkxbLKBwnifM06va/s1600/event3.png" /></a></div>
<br />
<br />
5) Right click on class CustTableEventHandler then New then Pre- or post-event handler as shown below.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgER85ur3Qc8g8YHeV8gVCA0QOJaxo2EkYCrHHITUpJvPZ0T-KvhaoDZEvYJr22L9eeIzxzAMvAGDTUX92oAx79TdI5nI7CUybzMr50T9txoU2q0EWk8Lo523fa4Q0kga7SqFcWv1gIiik_/s1600/event4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" qba="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgER85ur3Qc8g8YHeV8gVCA0QOJaxo2EkYCrHHITUpJvPZ0T-KvhaoDZEvYJr22L9eeIzxzAMvAGDTUX92oAx79TdI5nI7CUybzMr50T9txoU2q0EWk8Lo523fa4Q0kga7SqFcWv1gIiik_/s320/event4.png" width="320" /></a></div>
<br />
<br />
6) Once you click on this, system gives you a method as shown below. <br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXagzmz4Wh6c0nSkcqT2qr7TzXGrgzCAG865Sz2yxL8wDuXwOf5PPbqYNLrELgw0JjuEeRUz-gosycZgjt_eFTTafkIXuihb90mC7h9QcULWHg46U6oJjkKtXxvlASpVy1RkE6UQol6iBU/s1600/event5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="65" qba="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXagzmz4Wh6c0nSkcqT2qr7TzXGrgzCAG865Sz2yxL8wDuXwOf5PPbqYNLrELgw0JjuEeRUz-gosycZgjt_eFTTafkIXuihb90mC7h9QcULWHg46U6oJjkKtXxvlASpVy1RkE6UQol6iBU/s320/event5.png" width="320" /></a></div>
<br />
<br />
7) Customize the method as shown below. <br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2p_vNHVvmkDNG4CmbAQJUyeGYuFHDvTjq8V-inAi38sxbGL-wRKMyDW3QcAyncQ6tVrtXXD-8wOSosfFxU1UeXghybNIHTF38hE100Mmat-WO5hr1NvFiJCu45wH8v6knVCcu4W3xVnvW/s1600/event6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="90" qba="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2p_vNHVvmkDNG4CmbAQJUyeGYuFHDvTjq8V-inAi38sxbGL-wRKMyDW3QcAyncQ6tVrtXXD-8wOSosfFxU1UeXghybNIHTF38hE100Mmat-WO5hr1NvFiJCu45wH8v6knVCcu4W3xVnvW/s320/event6.png" width="320" /></a></div>
<br />
8) Here args is providing current record to custTable instance and info is displaying the current customer account. The code snippet is below.<br />
<br />
<span style="font-family: "Courier New", Courier, monospace;">public static void custCreateInfo(XppPrePostArgs _args)</span><br />
<span style="font-family: "Courier New", Courier, monospace;">{</span><br />
<span style="font-family: "Courier New", Courier, monospace;"> CustTable custTable;</span><br />
<span style="font-family: "Courier New", Courier, monospace;"> </span><span style="font-family: "Courier New", Courier, monospace;"> custTable = _args.getThis();</span><span style="font-family: "Courier New", Courier, monospace;"><br /></span><br />
<span style="font-family: "Courier New", Courier, monospace;"> info(strFmt("Customer account %1 has been created", custTable.AccountNum));</span><br />
<span style="font-family: "Courier New", Courier, monospace;">}</span><br />
<br />
This method I support to call from insert method of CustTable with type post event. It means that once insertion is done to CustTable, system will display recently inserted customer account number. It depends on your business requirement what logic you want to apply here. So here you can develop your required business logic or invoke pre built logic.<br />
<br />
9) Go to Tables node in AOT then find out CustTable.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1NxRZtgklLB44usgsz0cn9z41BSZTydN0Bk4BouZrRR_-Wykmaed_OGQIbAnbJrj3Lh0ESERg9Oslqb9quFMF-E_vQS7_q04vTOA2YhVo5ul5cF7hpFzX4_TGyoBoUihIA2yDui6NJfRS/s1600/event7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" qba="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1NxRZtgklLB44usgsz0cn9z41BSZTydN0Bk4BouZrRR_-Wykmaed_OGQIbAnbJrj3Lh0ESERg9Oslqb9quFMF-E_vQS7_q04vTOA2YhVo5ul5cF7hpFzX4_TGyoBoUihIA2yDui6NJfRS/s1600/event7.png" /></a></div>
<br />
10) Go to insert method of CustTable and right click on it then click on New Event Handler Subscription as shown below.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhivr6_H_hdk6f-Zz7MiIvWbEHdFB3oBJi6IuU0rqJiqmS02XSAii4gnijzpzDXpzZQowiA9V_pfuneBc7BroUIAoOcwOBJIIaMXwvAJdqicHyJaxqh-ipk5TsIaa0hcUyDifwZLMmSsM5L/s1600/event8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="150" qba="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhivr6_H_hdk6f-Zz7MiIvWbEHdFB3oBJi6IuU0rqJiqmS02XSAii4gnijzpzDXpzZQowiA9V_pfuneBc7BroUIAoOcwOBJIIaMXwvAJdqicHyJaxqh-ipk5TsIaa0hcUyDifwZLMmSsM5L/s320/event8.png" width="320" /></a></div>
<br />
<br />
11) After clicking you will get a new Event handler shown below. <br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivbpM3g-HlHOWV-meHexZB08FJxGbKT_9vdP1ap1b8ZO3iIxazyu9flutGN-pHvlSl3Ed37GzC-Gvw6oaog-exZ3uziE1a7JnCM2Bw071r1KmX4f9zsE37lLlpBCR3x_VKbiUbOj0FRJZk/s1600/event9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="117" qba="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivbpM3g-HlHOWV-meHexZB08FJxGbKT_9vdP1ap1b8ZO3iIxazyu9flutGN-pHvlSl3Ed37GzC-Gvw6oaog-exZ3uziE1a7JnCM2Bw071r1KmX4f9zsE37lLlpBCR3x_VKbiUbOj0FRJZk/s320/event9.png" width="320" /></a></div>
<br />
<br />
12) Rename the event handler to custCreateInfo and set the property as shown below. <br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUi4RmqlJHmjbNwPkF3yU3A_HlEoowQkZX5xfuTUsRnfWKEKEsO5gVONHGzKEm2b-rCnvu3IHWwDb7zGwghxnjOacn5jt2zsphxvKyLg_DHSyzCTFr0WoaJsT2zh6LBkLF8qmsj8h3p-ZA/s1600/event91.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="81" qba="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUi4RmqlJHmjbNwPkF3yU3A_HlEoowQkZX5xfuTUsRnfWKEKEsO5gVONHGzKEm2b-rCnvu3IHWwDb7zGwghxnjOacn5jt2zsphxvKyLg_DHSyzCTFr0WoaJsT2zh6LBkLF8qmsj8h3p-ZA/s320/event91.png" width="320" /></a></div>
<br />
<br />
13) Now save your work.<br />
<br />
14) Go to Customer form and create a new customer. Here I created a new customer account called “Test-000001”. <br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5sjbR7U6Hha-AdHT4FZRLriiyBsT72g85bMSYQuto_BajNtK9IZJ-QWoK-zsXZiwRE-Hr-SvsjNmmyLgDJR6xkRtAbMNEzazeYY-I645ZPQs7nziVCq5qlf5_lOqLoz1GwvPiMkagsjhX/s1600/event92.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="282" qba="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5sjbR7U6Hha-AdHT4FZRLriiyBsT72g85bMSYQuto_BajNtK9IZJ-QWoK-zsXZiwRE-Hr-SvsjNmmyLgDJR6xkRtAbMNEzazeYY-I645ZPQs7nziVCq5qlf5_lOqLoz1GwvPiMkagsjhX/s320/event92.png" width="320" /></a></div>
<br />
<br />
15) Once this customer is created system will give your infolog as shown below.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEge6Mh-n5uDyjdbPfQk_jqWmj5knK9zB4DcdcixCDMWf2w8QvARxc2-AQGNpzjWkiX2GUrx9w35QcKaIPg1O1Rsm6zxKrTzBp0qeMz9JOzHAxX6dl957-htQ9dud6gphB11FNzxRCDQwsmy/s1600/event93.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" qba="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEge6Mh-n5uDyjdbPfQk_jqWmj5knK9zB4DcdcixCDMWf2w8QvARxc2-AQGNpzjWkiX2GUrx9w35QcKaIPg1O1Rsm6zxKrTzBp0qeMz9JOzHAxX6dl957-htQ9dud6gphB11FNzxRCDQwsmy/s320/event93.png" width="260" /></a></div>
<br />
<br />
Hope this will help you to understand the event handler in Microsoft Dynamics AX 2012.</div>Rajesh Biswashttp://www.blogger.com/profile/07514591087556132461noreply@blogger.com9tag:blogger.com,1999:blog-7893807248327172219.post-73395433949711384872012-05-11T01:51:00.000-07:002012-05-11T01:52:01.297-07:00Microsoft Dynamics AX 2012 Cubes or Role center BI report error<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Verdana, sans-serif; font-size: x-small;">Microsoft Dynamics AX 2012 Cubes or Role center BI report error.<br />
<br />
In Microsoft Dynamics AX 2012 you might face problem with BI reports for role center or reports where Cubes are involve.<br />
<br />
There can be number of reasons for this and you will get number of errors. Like permission not granted, access denied, related data missing, cubes not processed etc.<br />
<br />
Two main reasons are (1) data missing in respective tables and (2) insufficient license.<br />
<br />
In most of the places data is interrelated among the tables. If you are missing related data in tables, it will give some errors.<br />
<br />
Secondly, by default Microsoft provides cubes for all the tables and assumption is you have 100% license. But when there is a limited license and you apply it to your application, based on limited license system drops few tables for which you do not have license. In such a scenario your queries for cubes are not updated and they are still using 100% tables but you don’t have 100% tables now because of limited license.<br />
<br />
Here the option for you is to update the queries but it’s a huge task. For Microsoft Dynamics AX 2009 you have to do it manually but to help you Microsoft published a tool to generate an excel sheet which tells you what are the areas you need to work.<br />
In case of Dynamics AX 2012, Microsoft provided few options in the form of a wizard from where you can do it by clicking a button as shown below:<br />
Path: Tools Business Intelligence (BI) Tools SQL Server Analysis Services project wizard.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEJAj3VwVRCn1bC9dY73ng-wF6GgCuYgTN1-tpY03IyZlGe2zMHoibJJhg1QHV7Ms8rd44Y3wQZ5mrRs8FzjV_xuGDR06sQ8Yxnh4ElMIYE6qK_Rf-UIexb7n1KGOvKEvLKNkjtNudVxqa/s1600/BICubeUpdate.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" dba="true" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEJAj3VwVRCn1bC9dY73ng-wF6GgCuYgTN1-tpY03IyZlGe2zMHoibJJhg1QHV7Ms8rd44Y3wQZ5mrRs8FzjV_xuGDR06sQ8Yxnh4ElMIYE6qK_Rf-UIexb7n1KGOvKEvLKNkjtNudVxqa/s320/BICubeUpdate.png" width="306" /></a></div>
<br />
In the above wizard if you select Update option and follow the wizard it resolve your problem.
<br /><br />
</span>Rajesh Biswashttp://www.blogger.com/profile/07514591087556132461noreply@blogger.com0tag:blogger.com,1999:blog-7893807248327172219.post-40107322769027931122012-04-14T08:39:00.006-07:002012-04-14T09:05:37.591-07:00How to open record directly from Info dialog in Microsoft Dynamics AX 2012<span style="font-family:verdana;"><strong>How to open record directly from Info dialog in Microsoft Dynamics AX 2012</strong></span>
<br />
<br /><div><span style="font-family:verdana;"><span style="font-size:85%;"><strong></strong></span></span></div>
<br /><div><span style="font-family:verdana;"><span style="font-size:85%;"><strong>Applied on:</strong></span></span>
<br /><span style="font-family:verdana;"><span style="font-size:85%;">Microsoft Dynamics® AX 2012 CU2.
<br /></span></span></div>
<br /><div><span style="font-family:verdana;"><span style="font-size:85%;"><strong>Target audience:</strong></span></span>
<br /><span style="font-family:verdana;"><span style="font-size:85%;">This article is for those who has at least basic knowledge of X++ programming.
<br /><strong></strong></span></span></div>
<br />
<br /><div><span style="font-family:verdana;"><span style="font-size:85%;"><strong></strong></span></span></div>
<br /><div><span style="font-family:verdana;"><span style="font-size:85%;"><strong>About this article:</strong></span></span>
<br /><span style="font-family:verdana;"><span style="font-size:85%;">During AX customization most of the time when you create / update / manipulate record, in general the record we display in an infolog to inform end user. It’s easy for end user to open and see the record from info log dialog using a show button or by double click on the message.</span></span></div>
<br />
<br /><div><span style="font-family:verdana;"><span style="font-size:85%;"></span></span></div>
<br /><div><span style="font-family:verdana;"><span style="font-size:85%;">This article can answers for below question:</span></span></div>
<br /><div><span style="font-family:verdana;"><span style="font-size:85%;">How to display Show button on info log dialog in Microsoft Dynamics® AX 2012?Double click on info log message and open the record in Microsoft Dynamics® AX 2012.Pass record to the info method, display Show button on info log dialog and open the form with current record in Microsoft Dynamics® AX 2012.Directly open record from info dialog / form in Microsoft Dynamics® AX 2012.
<br /></div></span></span>
<br />
<br /><div><span style="font-family:verdana;"><span style="font-size:85%;">Below is job which shows a vendor account in info log dialog and if you double click on the vendor account number it will open the vendor account detail form. </span></span></div>
<br /><div><span style="font-family:verdana;"><span style="font-size:85%;">Job:</span></span></div>
<br /><div><span style="font-family:verdana;"><span style="font-size:85%;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDeUH4wXjw7Hqi2VJtSBo7wZcUcLzq6RYmx2YlWwuPBylgcWQwuYa2SJ_f1L5UZSw9y4_uEJh5MEn30vzQFQoi6NUpUuFSJtmLKUbgFzltGSdcLKMeoOV14UN6dYO7pW33f6JY_mgnHZTe/s1600/Info_logjob.png"><img style="WIDTH: 241px; HEIGHT: 37px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5731284471695627970" border="0" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDeUH4wXjw7Hqi2VJtSBo7wZcUcLzq6RYmx2YlWwuPBylgcWQwuYa2SJ_f1L5UZSw9y4_uEJh5MEn30vzQFQoi6NUpUuFSJtmLKUbgFzltGSdcLKMeoOV14UN6dYO7pW33f6JY_mgnHZTe/s200/Info_logjob.png" /></a></span></span></div>
<br />
<br /><div><span style="font-family:verdana;"><span style="font-size:85%;"></span></span></div>
<br /><div><span style="font-family:Verdana;font-size:85%;">Info log:</span></div>
<br /><div><span style="font-family:verdana;"><span style="font-size:85%;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQnGhLkQHZgJYrNXq7lSANEklIWuFk-XdKc7GniFCF_urEzM2BZa9u-1ONZLa9EM7H4kZjmkZRQl5L6On8VzQuvLo3Oq3GcZfzu0eXuTKOiMqCQ-90yKfy5j0wBkgTXpMNrM7qwfYXEjzn/s1600/Info_logdialog.png"><img style="WIDTH: 200px; HEIGHT: 185px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5731284476002853106" border="0" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQnGhLkQHZgJYrNXq7lSANEklIWuFk-XdKc7GniFCF_urEzM2BZa9u-1ONZLa9EM7H4kZjmkZRQl5L6On8VzQuvLo3Oq3GcZfzu0eXuTKOiMqCQ-90yKfy5j0wBkgTXpMNrM7qwfYXEjzn/s200/Info_logdialog.png" /></a></span></span></div></span>
<br />Rajesh Biswashttp://www.blogger.com/profile/07514591087556132461noreply@blogger.com2tag:blogger.com,1999:blog-7893807248327172219.post-37981974335564309372012-02-21T02:07:00.018-08:002012-02-22T02:53:30.849-08:00In Microsoft Dynamics AX 2012 during data import using Excel Add-Ins you may experience an exception or error<div><span style="font-size:85%;"><span style="font-family:verdana;"><strong><span style="color: rgb(0, 0, 0);">In Microsoft Dynamics AX 2012 during data import using Excel Add-Ins you may experience an exception like: “You must include at least two items in any list used for updating data.”</span></strong><br><br /><strong><span style="color: rgb(102, 0, 0);"></span></strong></span></span></div><div><span style="font-size:85%;"><span style="font-family:verdana;"><strong><span style="color: rgb(102, 0, 0);">Applied on:</span></strong><br />Microsoft Dynamics AX 2012 CU2.<br /></span><span style="font-family:verdana;"><strong><span style="color: rgb(102, 0, 0);"></span></strong></span></span></div><br><div><span style="font-size:85%;"><span style="font-family:verdana;"><strong><span style="color: rgb(102, 0, 0);">Assumption:<br /></span></strong>This article is for those who has at least basic data flow and navigation<br />knowledge.</span></span></div><span style="font-size:85%;"><span style="font-family:verdana;"><div><br /></div></span><div><span style="font-family:verdana;"><strong><span style="color: rgb(102, 0, 0);">About this article:<br /></span></strong>This article may answers your question like-<br />• In Microsoft Dynamics AX 2012 how to handle exception during data import or data conversion?<br />• In Microsoft Dynamics AX 2012 how to copy master data from one environment to another environment and handle exception or error?<br />• In Microsoft Dynamics AX 2012 what are the new feature to export / import data?</span></div><span style="font-family:verdana;"><div><br /><strong><span style="color: rgb(102, 0, 0);">Exception:</span></strong><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWD-7pDTi4B_U-0zHeXV2gaNQqqvSwX3vu6v9dqO9X772FMYCNP991KbSYI2JQl6m3T1Gu4IZSIodeDtvs4i_mjjR1VtAxap1pF1aZsKMzxikoMBl8Py5LkZllRsHbUqCXQHi56Cly_EgM/s1600/DataImportTwoItems.png"><img style="width: 200px; height: 113px; cursor: pointer;" id="BLOGGER_PHOTO_ID_5711534541164683778" border="0" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWD-7pDTi4B_U-0zHeXV2gaNQqqvSwX3vu6v9dqO9X772FMYCNP991KbSYI2JQl6m3T1Gu4IZSIodeDtvs4i_mjjR1VtAxap1pF1aZsKMzxikoMBl8Py5LkZllRsHbUqCXQHi56Cly_EgM/s200/DataImportTwoItems.png" /></a><br /><strong><span style="color: rgb(102, 0, 0);"></span></strong></div><div><strong><span style="color: rgb(102, 0, 0);">Resolution:</span></strong><br />During data import using Excel Add-ins tool you need to select table(s). Once the table(s) is selected, by default system will select field(s) from table which is mandatory or part of primary index. If you have more than two fields like this then you will not face this exception or error. If there is one field which is mandatory or part of primary index in your table then system will select that field and put in the excel sheet and manually you need to select one more field along with this. In the above error screen if you see the red marked area where one more field to be added to get out of this exception.<br />Hope this is useful.</div></span><div></div></span><div></div>Rajesh Biswashttp://www.blogger.com/profile/07514591087556132461noreply@blogger.com4tag:blogger.com,1999:blog-7893807248327172219.post-3275770967107054232012-01-04T23:05:00.000-08:002012-01-05T00:52:17.491-08:00In Microsoft Dynamics AX 2012 how to copy configuration and setup data from one environment to another environment.<span style="font-family:verdana;"><span style="font-size:85%;"><strong>In Microsoft Dynamics AX 2012 how to copy configuration and setup data from one environment to another environment.</strong>
<br />
<br /><strong><span style="color:#660000;"><strong>Applied on:</strong></span></strong>
<br /></span><span style="font-family:verdana;"><span style="font-size:85%;">Microsoft Dynamics AX 2012 CU2.
<br />
<br /><span style="font-family:verdana;color:#660000;"><strong>Assumption:</strong></span>
<br />This article is for those who has at least basic data flow and navigation knowledge.
<br />
<br /><span style="font-family:verdana;color:#660000;"><strong>About this article:</strong></span></span>
<br /><span style="font-family:verdana;">
<br /><span style="font-size:85%;"><span style="font-family:verdana;">This article may answers your question like-
<br />• How to copy a legal entity from one environ to other environment? For instance; development environment to test environment, test environment to user acceptance training (UAT) environment, user acceptance training (UAT) environment to pre production environment, pre production environment to production environment etc.
<br />• In Microsoft Dynamics AX 2012 how to copy configuration or setup data from one environment to another environment?
<br />• In Microsoft Dynamics AX 2012 how to copy master data from one environment to another environment?
<br />• In Microsoft Dynamics AX 2012 how to copy transaction data from one environment to another environment?
<br />• In Microsoft Dynamics AX 2012 what are the new feature to export / import data?
<br />• In Microsoft Dynamics AX 2012 how to use definition group?
<br />• Is it possible to use duplicate company data for testing in Microsoft Dynamics AX 2012?
<br />• In Microsoft Dynamics AX 2012 how to export and import configuration?
<br />
<br />Microsoft recommends that you use the Microsoft Dynamics AX data export and import feature to support scenarios that previously required in AX 2009 the duplicate company feature. Means there is no button which you will press and system will create a duplicate company for you. But what about configuration data export and import?
<br />
<br />In Microsoft Dynamics AX 2009, the duplicate company feature was used extensively to copy data from one company to another. The feature was also used to build development or test environments, UAT, Preproduction and deployment scenarios that moved data from one environment to another. For example development to test environment, test environment to UAT environment, Pre production to Production environment etc. However this feature became obsolete in Microsoft Dynamics AX 2012.</span>
<br /></span></span></span></span>
<br /><span style="font-family:verdana;font-size:85%;">In Microsoft Dynamics AX 2012, company or data area is not a part of data security boundary and the new thing Microsoft introduced is organization model where data is not related to a company or legal entity. At table level there is property called SaveDataPerCompany which is the replacement of company concept. If you set this property to Yes, you hold company specific data in table.
<br />How to copy a legal entity from one environment to another environment? </span>
<br />
<br /><span style="font-family:verdana;font-size:85%;"><strong>Following are the steps to use an existing legal entity as a template for other legal entities.</strong>
<br /></span><span style="font-family:verdana;font-size:85%;"><strong>1.</strong> Create a legal entity to use as a template.
<br /></span>
<br /><span style="font-family:verdana;font-size:85%;"><strong>2.</strong> Set all configuration data for the source legal entity.
<br /></span>
<br /><span style="font-family:verdana;font-size:85%;"><strong>3.</strong> Create a definition group which can be used to export data.
<br /><strong>a)</strong> To create a definition group, open your AX client. Go to System <strong>Administration module->Common->Data export/import->Definition groups</strong>->Click on <strong>New</strong> button or <strong>Ctrl + N</strong>. On <strong>General</strong> tab of Create table definition group form, provide your <strong>Definition group</strong> and <strong>Description</strong>.
<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYa47ZjXUXy9w_e-lyL2jFf6fpv-lVLFslKS42m7_2NMEsKwzafyjbuRVmdnfU3ZXXo3Tq3dK9w6ZXQdoubb3E9piCZEfxEMe3dLbIuMgNXy66vPpKuQccHRfkBjUsIEzf5_kSTnt0WjCq/s1600/Image1.jpg"><img id="BLOGGER_PHOTO_ID_5694046168304127250" style="WIDTH: 200px; CURSOR: hand; HEIGHT: 125px" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYa47ZjXUXy9w_e-lyL2jFf6fpv-lVLFslKS42m7_2NMEsKwzafyjbuRVmdnfU3ZXXo3Tq3dK9w6ZXQdoubb3E9piCZEfxEMe3dLbIuMgNXy66vPpKuQccHRfkBjUsIEzf5_kSTnt0WjCq/s200/Image1.jpg" border="0" /></a>
<br />
<br /><strong>b)</strong> On <strong>Options</strong> tab of above form check <strong>Include shared tables</strong> check box as shown below.
<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjI9EaMaKbsjc99hGWNLC7xrBNCimlMk6YfOuNa_rrdMbywfOyZouLNecGWCW1PEabRAfbajsolpvUxbW43P8htsLXSNhovV9buEbq7uxG9-vrsrZrQivGPHrYKu09NZ2zqtaBuM4-ldvCI/s1600/Image2.png"><img id="BLOGGER_PHOTO_ID_5694046168507195778" style="WIDTH: 200px; CURSOR: hand; HEIGHT: 126px" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjI9EaMaKbsjc99hGWNLC7xrBNCimlMk6YfOuNa_rrdMbywfOyZouLNecGWCW1PEabRAfbajsolpvUxbW43P8htsLXSNhovV9buEbq7uxG9-vrsrZrQivGPHrYKu09NZ2zqtaBuM4-ldvCI/s200/Image2.png" border="0" /></a>
<br />You should not check <strong>Include system tables</strong> check box, <strong>Include database log tables</strong>, Include <strong>cross-reference tables</strong>. For example if you include system tables it may stop you to access AX client.
<br />
<br /><strong>c)</strong> This part is important: To export configuration data, include the following table groups: <strong>Reference, Parameter, Group, Framework</strong>, and <strong>Miscellaneous</strong> as shown below.
<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEAsqly7n6dFg4BX5yPfsJP4Woem1NuMIK1lzsgBWSxC0yYxp0Q1z0UEgzcITG1sJoJFUIeKaQ92WIAM9jTjd9F6RtbP9FZ5VjaMYNWL2DBCevZefpJgfZ9PKYpMa5O85UyXhC48OVira5/s1600/Image3.png"><img id="BLOGGER_PHOTO_ID_5694046179385747202" style="WIDTH: 200px; CURSOR: hand; HEIGHT: 126px" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEAsqly7n6dFg4BX5yPfsJP4Woem1NuMIK1lzsgBWSxC0yYxp0Q1z0UEgzcITG1sJoJFUIeKaQ92WIAM9jTjd9F6RtbP9FZ5VjaMYNWL2DBCevZefpJgfZ9PKYpMa5O85UyXhC48OVira5/s200/Image3.png" border="0" /></a>
<br />
<br /><strong>d)</strong> To export <strong>master data</strong>, you must include the tables that are in the <strong>Main</strong> table group.
<br />
<br /><strong>e)</strong> Do not include the tables that are in the <strong>Transaction, Transaction header, Transaction line</strong>, <strong>Worksheet, Worksheet header</strong>, and <strong>Worksheet</strong> line table groups. These tables include transaction data. It can be difficult to create a duplicate environment for transaction data if the <strong>SaveDataPerCompany</strong> property of tables is set to <strong>No</strong>. For transaction date Microsoft SQL Server backup and restore mechanism is one of best option but a minor configuration changes can be made to illustrate specific Microsoft Dynamics AX features.
<br />
<br /><strong>f)</strong> Now click on <strong>OK</strong> button to create definition group.
<br />
<br /><strong>4.</strong> Now you are ready with Definition group to export data for a legal entity (Company). Go to <strong>System Administration module->Common->Data export/import->Export to</strong>. Select your <strong>Definition group</strong> from drop down and provide the file <strong>Name</strong> (and location). Remaining things are up to your choice. Clock on <strong>OK</strong> button. This will create a <strong>.dat</strong> file with your given name using the Microsoft Dynamics AX data export and import feature to export the legal entity to a .dat file.</span>
<br /></span><span style="font-size:85%;"><span style="font-family:verdana;">
<br /><strong>5.</strong> In the new environment, create new legal entities, and then import the .dat file that you created into each entity individually (in step 4). Go to <strong>System Administration module->Common->Data export/import->Import</strong>. Select your <strong>Definition groups</strong> from the drop down and provide file <strong>Name</strong> (and location). Remember if you have different environment create a same definition group in your new environment where you are support to import data for a legal entity. On <strong>Advance</strong> tab there are different options but you may go for <strong>Include shared tables</strong>.
<br /></span>
<br /></span><span style="font-family:verdana;font-size:85%;">Shared and per-company data is imported. When other legal entities are subsequently imported into the new legal entities, the shared data is merged.
<br />
<br /><strong>NOTE:</strong> Please use at your own risk. There is no warranty on this article.</span><strong></strong>Rajesh Biswashttp://www.blogger.com/profile/07514591087556132461noreply@blogger.com4