tag:blogger.com,1999:blog-39147348437675456982024-03-19T01:48:42.063-07:00Microsoft Dynamics AXDynamics AX FAQ / Tips & Tricks / X++ DevelopmentUnknownnoreply@blogger.comBlogger250125tag:blogger.com,1999:blog-3914734843767545698.post-91855904167244435242015-05-26T18:42:00.000-07:002015-05-26T18:42:10.631-07:00Over delivery of line is 100 percent, but the allowed over delivery is only 0 percent.<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="color: #303131; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background-color: white;"><i><b>Q: I am getting the following error in AX 2009, how can I fix it?</b></i></span></div>
<div style="margin: 0in;">
<span style="background-color: white; font-size: 12px;"><span style="color: #303131; font-family: Courier New;"><i><b>"Over delivery of line is 100 percent, but the allowed over deliv</b>ery is only 0 percent."</i></span></span></div>
<div style="margin: 0in;">
<span style="background-color: white; font-size: 12px;"><span style="color: #303131; font-family: Courier New;"><i><br /></i></span></span></div>
<div style="color: #303131; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white; font-style: italic;">A:</span></div>
<div style="color: #303131; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white; font-style: italic;">Use the following script</span></div>
<div style="color: #303131; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white; font-style: italic;">static void
fixPurchaseOrders(Args _args)</span></div>
<div style="color: #303131; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white; font-style: italic;">{</span></div>
<div style="color: #303131; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white; font-style: italic;"> PurchParmTable purchParmTable;</span></div>
<div style="color: #303131; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white; font-style: italic;"> PurchParmLine purchParmLine;</span></div>
<div style="color: #303131; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white; font-style: italic;"> ;</span></div>
<div style="color: #303131; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white; font-style: italic;"> ttsbegin;</span></div>
<div style="color: #303131; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white; font-style: italic;"> while select forupdate
purchParmTable</span></div>
<div style="color: #303131; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white; font-style: italic;"> join
forupdate purchParmLine</span></div>
<div style="color: #303131; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white; font-style: italic;"> where
purchParmLine.ParmId == purchParmTable.ParmId</span></div>
<div style="color: #303131; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white; font-style: italic;">
&& purchParmLine.TableRefId ==
purchParmTable.TableRefId</span></div>
<div style="color: #303131; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white; font-style: italic;">
&& purchParmTable.PurchId == "<po>"</po></span></div>
<div style="color: #303131; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white; font-style: italic;">
&& purchParmTable.ParmJobStatus == ParmJobStatus::Waiting</span></div>
<div style="color: #303131; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white; font-style: italic;">
&& purchParmTable.Ordering == DocumentStatus::Invoice</span></div>
<div style="color: #303131; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white; font-style: italic;"> if(purchParmTable.RecId
|| purchParmLine.RecId)</span></div>
<div style="color: #303131; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white; font-style: italic;"> {</span></div>
<div style="color: #303131; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white; font-style: italic;">
purchParmTable.delete();</span></div>
<div style="color: #303131; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white; font-style: italic;">
purchParmLine.delete();</span></div>
<div style="color: #303131; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white; font-style: italic;"> }</span></div>
<div style="color: #303131; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white; font-style: italic;"> ttscommit;</span></div>
<br />
<div style="color: #303131; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white; font-style: italic;">}</span></div>
</div>
Unknownnoreply@blogger.com23tag:blogger.com,1999:blog-3914734843767545698.post-77896039700508373842014-11-27T16:08:00.004-08:002014-11-27T16:08:57.603-08:00How to build a User List Lookup / Drop Down in AX 2009<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: red; font-style: italic; font-weight: bold; mso-highlight: red;">User
List Lookup / Drop Down </span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic;">Step 1:Create a method in the form to get the user
list lookup</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic;">void userListLookup(FormStringControl control)</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic;">{</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic;"> Args args;</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic;">
MenuFunction menuFunction;</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic;"> Object formRun;</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic;">;</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic;"> args = new
Args();</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic;">
menuFunction = new
MenuFunction(menuitemdisplaystr(WorkflowUserListLookup),
MenuItemType::Display);</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic;"> args = new
Args(menuFunction.object());</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic;">
args.caller(element);</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic;">
args.parm(control.text());</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic;"> formRun =
ClassFactory::formRunClassOnClient(args);</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic;">
formRun.init();</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic;">
formRun.run();</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic;">
formRun.wait();</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic;"> if
(formRun.closedOk())</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic;"> {</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic;">
control.text(formRun.parmTo());</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic;">
element.redraw();</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic;"> }</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic;">}</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic;">Step 2: Call the method in the lookup event of the
EDT</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic;">public void lookup()</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic;">{</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic;">
element.userListLookup(this);</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic;">}</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<br />
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic;">Alternative Method: Just select
WorkflowUserListLookup as formhelp on your EDT</span></div>
</div>
Unknownnoreply@blogger.com14tag:blogger.com,1999:blog-3914734843767545698.post-40177829712677638302014-11-18T20:04:00.002-08:002014-11-18T20:13:51.642-08:00How to import and compile an xpo from Start Up<div dir="ltr" style="text-align: left;" trbidi="on">
<div lang="en-US" style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div lang="en-US" style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<div lang="en-US" style="font-size: 9pt; margin: 0in;">
<span style="background: red; font-weight: bold; mso-highlight: red;">How to import and
compile an xpo from Start Up</span></div>
<div lang="en-US" style="font-size: 9pt; margin: 0in;">
In
order to import an XPO from command line in <span style="font-weight: bold;">AX
2009</span> we can use AX32.exe StartUp command; </div>
<div style="font-size: 9pt; margin: 0in;">
<span style="font-style: italic;">ax32.exe -StartupCmd=AutoRun_c:\Configuration.XML</span></div>
<div lang="en-US" style="font-size: 9pt; margin: 0in;">
<br /></div>
<div lang="en-US" style="font-size: 9pt; margin: 0in;">
The
configuration XML would contain path to the AOT object to compile after import
the XPO.</div>
<div lang="en-US" style="font-size: 9pt; margin: 0in;">
<span style="font-style: italic;"></span></div>
<div lang="en-US" style="font-size: 9pt; margin: 0in;">
<span style="font-style: italic;"><axaptaautorun span=""></axaptaautorun></span></div>
<div lang="en-US" style="font-size: 9pt; margin: 0in;">
<span style="font-style: italic;">
exitWhenDone="true" </span></div>
<div lang="en-US" style="font-size: 9pt; margin: 0in;">
<span style="font-style: italic;">
version="4.0" </span></div>
<div lang="en-US" style="font-size: 9pt; margin: 0in;">
<span style="font-style: italic;">
logFile="C:\Temp\AxaptaAutorun.log"></span></div>
<div lang="en-US" style="font-size: 9pt; margin: 0in;">
<br /></div>
<div lang="en-US" style="font-size: 9pt; margin: 0in;">
<span style="font-style: italic;">
file="C:\Temp\CodeFile.xpo" /> </span></div>
<div lang="en-US" style="font-size: 9pt; margin: 0in;">
<span style="font-style: italic;"><compileapplication crossreference="true" node="\Forms\EnvironmentIndicator"></compileapplication></span></div>
<div lang="en-US" style="font-size: 9pt; margin: 0in;">
<span style="font-style: italic;"></span></div>
</div>
</div>
<br />
<div lang="en-US" style="font-size: 9pt; margin: 0in;">
References:
<a href="http://msdn.microsoft.com/en-us/library/aa870082(v=ax.50).aspx">http://msdn.microsoft.com/en-us/library/aa870082(v=ax.50).aspx</a></div>
Unknownnoreply@blogger.com13tag:blogger.com,1999:blog-3914734843767545698.post-73855324465250097712014-10-20T23:21:00.001-07:002014-11-13T21:20:59.327-08:00AX 2012 Development Cheat Sheet<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="font-family: "Calibri Light"; font-size: 20.0pt; margin: 0in;">
AX
2012 Development Cheat Sheet / X++ Cheat Sheet</div>
<div style="color: grey; font-family: Calibri; font-size: 10.0pt; margin: 0in;">
Wednesday,
21 May 2014</div>
<div style="color: grey; font-family: Calibri; font-size: 10.0pt; margin: 0in;">
3:02 PM</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic; font-weight: bold;">How to access individual field on
the form using form data source?</span></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
myTable_ds.object(
fieldNum( myTable, myField ) ).visible( false );</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic; font-weight: bold;">How to create an auto lookup without
writing code where Field 2 lookup is based on Field 1 Value?</span></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
In order to achieve
this create a relationship in the related table but make sure Field 1 is the
first relation in the relationship and Field 2 is the second relation. This can
be done by actually creating Field 2 relation before Field 1.</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic; font-weight: bold;">How to create a simple dialog box?</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
Dialog dialog;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
DialogField
field;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
dialog = new
Dialog("My Dialog");</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
dialog.addText("Select
your favorite customer:");</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
field =
dialog.addField(ExtendedTypeStr(CustAccount));</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
dialog.run();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
if
(dialog.closedOk())</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin-left: .375in; margin: 0in;">
info(field.value());</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic; font-weight: bold;">How to convert string to enum?</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
SMATransactionType transactionType;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
transactionType
= str2enum(transactionType, "Hour"); </div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
info(enum2str(transactionType));</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic; font-weight: bold;">Date Time Affectivity</span></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<a href="http://dynamics-ax-chronicles.blogspot.com.au/2011/09/date-effective-tables-with.html">http://dynamics-ax-chronicles.blogspot.com.au/2011/09/date-effective-tables-with.html</a></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
utcDateTime
fromDateTime, toDateTime;<br />
fromDateTime = DateTimeUtil::newDateTime(3\3\2012, 0);<br />
toDateTime = DateTimeUtil::maxValue();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="font-weight: bold;">#Selecting a time effective record based on from date</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
select
validTimeState(fromDateTime) table;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="font-weight: bold;">#Selecting a time effective record based on from date
and to date</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
select
validTimeState(fromDateTime, toDateTime) table;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic; font-weight: bold;">Import Text File</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
static void
RB_ReadTextFile(Args _args)</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
Filename
filename = @'C:\Desktop\AX2012.txt';</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
System.IO.StreamReader
reader;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
System.String line;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
InteropPermission
interopPermission;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
Str
text;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
interopPermission = new InteropPermission(InteropKind::ClrInterop);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
interopPermission.assert();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
reader = new System.IO.StreamReade(filename,System.Text.Encoding::get_UTF8());</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
line = reader.ReadLine();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
while (!System.String::IsNullOrEmpty(line))</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
line = reader.ReadLine();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
text = line;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
info(strfmt("%1", text));</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
reader.Close();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
reader.Dispose();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic; font-weight: bold;">Import CSV File</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
static void
RB_ReadCsvFile(Args _args)</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
#File</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
IO iO;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
CustAccount custAccount;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
CustName custname;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
FilenameOpen filename =
"C:\\Desktop\\RB.csv";</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
Container record;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
boolean first = true;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
iO = new CommaTextIo(filename,#IO_Read);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
if (! iO || iO.status() != IO_Status::Ok)</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
throw error("@SYS19358");</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
while (iO.status() == IO_Status::Ok)</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
record = iO.read();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
if (record)</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
if (first) // to exclude the header</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
first = false;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
else</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
custAccount = conpeek(record, 1);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
custname = conpeek(record, 2);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
info(strfmt('%1--%2',custAccount,custname));</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic; font-weight: bold;">Import Excel File</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
// >>>
abdul @ 4th June 2014 / This job is used to update the parking locations for
all shifts</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
//>>>
Excel Format / Shift ID, Block ID, Parking Location</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
static void MSTA_DM_Roster_UpdateParkingLocations(Args
_args)</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
//Dialog Field</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
Dialog fileDialog;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
DialogField sharedPath;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
// Excel Setup</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
SysExcelApplication application;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
SysExcelWorkbooks workbooks;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
SysExcelWorkbook workbook;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
SysExcelWorksheets worksheets;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
SysExcelWorksheet worksheet;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
SysExcelCells cells;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
COMVariantType type;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
int row = 1;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
//Data Setup</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
MSTARosterGroupLine rosterGroupLine;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
MSTARosterLine rosterLine;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
str 20 shiftFilter;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
fileDialog = new Dialog("Select
parking locations improt files for company " + curext());</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
fileDialog.addText("Select parking
locations improt files for company " + curext());</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
sharedPath =
fileDialog.addField(extendedTypeStr(FilenameOpen), "File Path");</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
fileDialog.run();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
if (fileDialog.closedOk())</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
try</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
application =
SysExcelApplication::construct();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
workbooks =
application.workbooks();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
//TODO: Enter the excel file path</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
workbooks.open(sharedPath.value());</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
workbook = workbooks.item(1);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
worksheets = workbook.worksheets();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
worksheet =
worksheets.itemFromNum(1);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
cells = worksheet.cells();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
ttsBegin;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
do</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
//First row should be column
names</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
row = row + 1;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
while select forupdate
rosterGroupLine </div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
where
rosterGroupLine.ShiftId == Global::COMVariant2Str(cells.item(row,
1).value()) </div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
rosterGroupLine.ParkingLocationUniqueId =
Global::COMVariant2Str(cells.item(row, 3).value());</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
rosterGroupLine.update();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
while select forUpdate
rosterLine</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
where
rosterLine.GroupRefId == rosterGroupLine.RecId</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
if(rosterLine.VehicleBlockId == Global::COMVariant2Str(cells.item(row,
2).value()))</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
rosterLine.ParkingLocationUniqueId =
Global::COMVariant2Str(cells.item(row, 3).value());</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
rosterLine.update();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
type = cells.item(row,
1).value().variantType();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}while (type !=
COMVariantType::VT_EMPTY);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
application.quit();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
info("Records Import " +
int2str(row));</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
ttsCommit;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
catch</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
ttsAbort;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
application.quit();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
error("@SYS80663");</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic; font-weight: bold;">Importing Data from Database</span></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic; font-weight: bold;">Which EDT is associated with File
Selection and Folder Selection</span></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
For folder use
FilePath EDT</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
For File Name use
FileNameOpen EDT</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic; font-weight: bold;">How to make any alphabet as capital
letter?</span></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
Use strUp method</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic; font-weight: bold;">How to create manual auto numbering
system?</span></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
A technique I used in
HR was as below,</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
// >>>
abdul @ 3rd June 2014 / Get New Auto Number Based On Company</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
public static
str getNewPersonnelNumber()</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
int maxLenght = 4;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
str tempEmployeeID;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
str newNumber;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
int newIndex;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
str companyIdx;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
HCMWorker localWorker;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
str ret;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
str 2 companyIdFilter;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
//Pickup the first digit as company name</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
companyIdx = String::trimToLength(curext(),
1);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
companyIdx = strUpr(companyIdx);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
companyIdFilter = companyIdx + '*';</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
select firstOnly localWorker</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
order by localWorker.PersonnelNumber
desc</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
where localWorker.PersonnelNumber like
companyIdFilter;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
tempEmployeeID =
localWorker.PersonnelNumber;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
newNumber =
String::replaceAll(tempEmployeeID, companyIdx, "");</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
newIndex = str2int(newNumber);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
newIndex = newIndex + 1;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
newNumber = String::fillString(maxLenght -
strLen(int2str(newIndex)), '0') + int2str(newIndex);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
newNumber = companyIdx + newNumber;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
ret
= newNumber;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
return ret;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
// >>>
abdul @ 3rd June 2014 / Get New Auto Number Based On Company</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic; font-weight: bold;">Creating a form at run time /
dynamic form</span></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<a href="http://dynamicsax-dev.blogspot.com.au/2008/07/creating-form-at-run-time.html">http://dynamicsax-dev.blogspot.com.au/2008/07/creating-form-at-run-time.html</a></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic; font-weight: bold;">Creating and saving AX object on
runtime (Saving in AOT Tree)</span></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<a href="http://axblog4u.wordpress.com/2010/12/04/treenode-aot-save-%E2%80%93-did-you-know/">http://axblog4u.wordpress.com/2010/12/04/treenode-aot-save-%E2%80%93-did-you-know/</a></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="background: lime; font-style: italic; font-weight: bold; mso-highlight: lime;">Creating
a sys progress bar</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
#AviFiles</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
SysOperationProgress progressBar = new SysOperationProgress();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
// Initialising
progress bar</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
progressBar.setCaption("Export
To Excel in progress...");</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
progressBar.setAnimation(#AviTransfer);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
progressBar.setText(strfmt("Employee
%1", emplTable.name()));</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="background: lime; font-style: italic; font-weight: bold; mso-highlight: lime;">Traversing
a data source on a form</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
PRMJournalTransHeader
journalTransHeaderLocal;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
if(Box::yesNo("@BCS10177",
DialogButton::No) == DialogButton::Yes)</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
ttsbegin;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
for (journalTransHeaderLocal =
PRMJournalTransHeader_DS.getFirst();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
journalTransHeaderLocal;
journalTransHeaderLocal = PRMJournalTransHeader_DS.getNext() )</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
PRMGenerateEarningAndDeductions::generateAllDedAndEarns(journalTransHeaderLocal);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
ttscommit;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
PRMJournalTransHeader_ds.executeQuery();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="background: red; font-style: italic; font-weight: bold; mso-highlight: red;">Ledger
Dimensions Functionality</span></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic; font-weight: bold;">Print the financial dimensions for
all employments</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
static void
MSTA_HR_140610_EmplDim(Args _args)</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
HcmWorker worker;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
HcmEmployment employment;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
#AviFiles</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
SysOperationProgress progressBar = new SysOperationProgress();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
// Initialising progress bar</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
progressBar.setCaption("Printing in
progress...");</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
progressBar.setAnimation(#AviTransfer);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
while select worker</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
progressBar.setText(strfmt("Employee %1", worker.name()));</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
employment =
HcmEmployment::getActiveEmploymentsByWorker(worker.RecId);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
if(employment.DefaultDimension)</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
info(strFmt("%1, %2,
Department Value: %3", worker.PersonnelNumber, worker.name(),
getDefaultDimensionValue(employment.DefaultDimension,
"Department")));</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
} </div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="background: red; font-style: italic; font-weight: bold; mso-highlight: red;">How
to get the dimension value from a ledger dimension</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
static str 255
getDefaultDimensionValue(RecId defaultDimension, Name dimName)</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
str 255 ret;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
DimensionAttributeValueSetStorage
dimStorage;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
dimStorage =
DimensionAttributeValueSetStorage::find(defaultDimension);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
ret =
dimStorage.getDisplayValueByDimensionAttribute(DimensionAttribute::findByName(dimName).RecId);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
return ret;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="background: red; font-style: italic; font-weight: bold; mso-highlight: red;">How
to get the dimension value from a ledger dimension</span></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
static RecId
setDefaultDimensionValue(RecId defaultDimension, Name dimName, str 255
dimValue)</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
DimensionAttributeValueSetStorage
dimStorage;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
Counter i;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
DimensionAttribute dimAttributeCostCenter;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
DimensionAttributeValue dimAttributeValue;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
dimStorage =
DimensionAttributeValueSetStorage::find(defaultDimension);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
dimAttributeCostCenter =
DimensionAttribute::findByName(dimName);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
if(dimValue)</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
dimAttributeValue =
DimensionAttributeValue::findByDimensionAttributeAndValue(dimAttributeCostCenter,
dimValue, true, true);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
dimStorage.addItem(dimAttributeValue);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
else</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
dimStorage.removeDimensionAttribute(DimensionAttribute::findByName(dimName).RecId);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
return dimStorage.save();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="background: red; font-style: italic; font-weight: bold; mso-highlight: red;">How
to update worker dimension values</span></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
static void
MSTA_HR_140610_UpdateEmplDim(Args _args)</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
HcmWorker worker;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
HcmEmployment employment;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
#AviFiles</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
SysOperationProgress progressBar = new SysOperationProgress();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
// Initialising progress bar</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
progressBar.setCaption("Printing in
progress...");</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
progressBar.setAnimation(#AviTransfer);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
ttsBegin;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
while select worker</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
progressBar.setText(strfmt("Employee %1", worker.name()));</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
employment =
HcmEmployment::getActiveEmploymentsByWorker(worker.RecId);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
employment.selectForUpdate(true);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
employment.validTimeStateUpdateMode(ValidTimeStateUpdate::Correction);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
if(employment.DefaultDimension)</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
employment.DefaultDimension =
Global::setDefaultDimensionValue( employment.DefaultDimension,
"Contract", "None");</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
employment.DefaultDimension =
Global::setDefaultDimensionValue( employment.DefaultDimension,
"ContractType", "None");</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
employment.update();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
info(strFmt("%1, %2,
Department Value: %3", worker.PersonnelNumber, worker.name(),</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
getDefaultDimensionValue(employment.DefaultDimension,
"Department")));</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
ttsCommit;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="background: red; font-weight: bold; mso-highlight: red;">How Can I use
distinct / unique is X++ statements?</span></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
Use
'GroupBy' in the select statement which field you want the distinct
records.</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="background: red; font-weight: bold; mso-highlight: red;">A4 portrait and
landscape paper size?</span></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
The paper size for A4
portrait is 8.27 * 11.69 inches and for Landscape is 11.69 * 8.27. Make sure
that the page size is inclusive of the margins.</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
The paper size for A4
portrait is 210 * 297 mm and for Landscape is 297 * 210. Make sure that the
page size is inclusive of the margins.</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="background: red; font-weight: bold; mso-highlight: red;">How to convert EDT to
str to be used in dialog fields?</span></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
Use <span style="font-style: italic; font-weight: bold;">extendedTypeStr</span></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="background: red; font-weight: bold; mso-highlight: red;">How to shrink the
database log files?</span></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
See names of the log
file in DB</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
SELECT name,
physical_name AS current_file_location</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
FROM sys.master_files</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
USE
AdventureWorks2012;<br />
GO<br />
-- Truncate the log by changing the database recovery model to
SIMPLE.<br />
ALTER DATABASE AdventureWorks2012<br />
SET RECOVERY SIMPLE;<br />
GO<br />
-- Shrink the truncated log file to 1 MB.<br />
DBCC SHRINKFILE (AdventureWorks2012_Log, 1);<br />
GO<br />
-- Reset the database recovery model.<br />
ALTER DATABASE AdventureWorks2012<br />
SET RECOVERY FULL;<br />
GO</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="background: red; font-weight: bold; mso-highlight: red;">How to export to
Excel?</span></div>
<div style="font-family: consolas; font-size: 9.0pt; margin: 0in;">
<span style="background: white; color: darkblue; font-weight: bold;">static</span><span style="background: white;"> </span><span style="background: white; color: darkblue; font-weight: bold;">void</span><span style="background: white;"> SR_SysExcelWorksheetHelper(Args _args)</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;">{</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;"> CustTable custTable;</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;"> SysExcelWorksheetHelper
worksheetHelper;</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;"> SysExcelHelper sysExcelHelper;</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;"> SysExcelWorksheet worksheet;</span></div>
<div style="font-family: consolas; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> </span><span style="background: white; color: darkblue; font-weight: bold;">int</span><span style="background: white;"> currentRow
= </span><span style="background: white; color: red; font-weight: bold;">1</span><span style="background: white;">;</span></div>
<div style="font-family: consolas; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> </span><span style="background: white; color: darkblue; font-weight: bold;">int</span><span style="background: white;"> sumRow;</span></div>
<div style="font-family: consolas; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> </span><span style="background: white; color: darkblue; font-weight: bold;">str</span><span style="background: white;"> worksheetName;</span></div>
<div style="font-family: consolas; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> </span><span style="background: white; color: darkblue; font-weight: bold;">int</span><span style="background: white;"> redColor
= WinAPI::RGB2int(</span><span style="background: white; color: red; font-weight: bold;">255</span><span style="background: white;">, </span><span style="background: white; color: red; font-weight: bold;">0</span><span style="background: white;">, </span><span style="background: white; color: red; font-weight: bold;">0</span><span style="background: white;">);</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;"> SysExcelRange range;</span></div>
<div style="font-family: consolas; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> COMVariant cellValue
= </span><span style="background: white; color: darkblue; font-weight: bold;">new</span><span style="background: white;"> COMVariant(COMVariantInOut::Out);</span></div>
<div style="font-family: consolas; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> </span><span style="background: white; color: darkblue; font-weight: bold;">str</span><span style="background: white;"> fileName;</span></div>
<div style="font-family: consolas; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> </span><span style="background: white; color: darkblue; font-weight: bold;">str</span><span style="background: white;"> attachmentPath = </span><span style="background: white; color: darkred;">"C:\\"</span><span style="background: white;">;</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<br /></div>
<div style="font-family: consolas; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> </span><span style="background: white; color: green; font-style: italic;">// Sets the font color
for a range of cells</span></div>
<div style="font-family: consolas; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> </span><span style="background: white; color: darkblue; font-weight: bold;">void</span><span style="background: white;"> setRangeFont(</span><span style="background: white; color: darkblue; font-weight: bold;">int</span><span style="background: white;"> _fromColumn, </span><span style="background: white; color: darkblue; font-weight: bold;">int</span><span style="background: white;"> _fromRow, </span><span style="background: white; color: darkblue; font-weight: bold;">int</span><span style="background: white;"> _toColumn, </span><span style="background: white; color: darkblue; font-weight: bold;">int</span><span style="background: white;"> _toRow, </span><span style="background: white; color: darkblue; font-weight: bold;">int</span><span style="background: white;"> _rgbIntColor)</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;"> {</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;"> range
= worksheetHelper.getWorksheetRange(_fromColumn, _fromRow, _toColumn, _toRow);</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;"> worksheetHelper.setFontColor(range,
_rgbIntColor);</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;"> }</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<br /></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<br /></div>
<div style="font-family: consolas; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> </span><span style="background: white; color: green; font-style: italic;">// Defines the columns
of the spreadsheet</span></div>
<div style="font-family: consolas; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> #define.AccountNum(</span><span style="background: white; color: red; font-weight: bold;">1</span><span style="background: white;">)</span></div>
<div style="font-family: consolas; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> #define.Currency(</span><span style="background: white; color: red; font-weight: bold;">2</span><span style="background: white;">)</span></div>
<div style="font-family: consolas; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> #define.CustGroup(</span><span style="background: white; color: red; font-weight: bold;">3</span><span style="background: white;">)</span></div>
<div style="font-family: consolas; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> #define.BalanceMST(</span><span style="background: white; color: red; font-weight: bold;">4</span><span style="background: white;">)</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<br /></div>
<div style="font-family: consolas; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> worksheetName
= </span><span style="background: white; color: darkviolet;">"@SYS135880"</span><span style="background: white;">;</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<br /></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;"> sysExcelHelper =
SysExcelHelper::construct();</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<br /></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;"> sysExcelHelper.initialize();</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<br /></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;"> worksheet =
sysExcelHelper.addWorksheet(worksheetName);</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<br /></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;"> worksheetHelper =
SysExcelWorksheetHelper::construct(worksheet);</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<br /></div>
<div style="font-family: consolas; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> </span><span style="background: white; color: green; font-style: italic;">// Populate the header
row with the appropriate field labels and format the columns</span></div>
<div style="font-family: consolas; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> worksheetHelper.addColumnFromTableField(#AccountNum, </span><span style="background: white; color: darkblue; font-weight: bold;">tablenum</span><span style="background: white;">(CustTable), </span><span style="background: white; color: darkblue; font-weight: bold;">fieldnum</span><span style="background: white;">(CustTable, AccountNum));</span></div>
<div style="font-family: consolas; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> worksheetHelper.addColumnFromTableField(#Currency, </span><span style="background: white; color: darkblue; font-weight: bold;">tablenum</span><span style="background: white;">(CustTable), </span><span style="background: white; color: darkblue; font-weight: bold;">fieldnum</span><span style="background: white;">(CustTable, Currency));</span></div>
<div style="font-family: consolas; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> worksheetHelper.addColumnFromTableField(#CustGroup, </span><span style="background: white; color: darkblue; font-weight: bold;">tablenum</span><span style="background: white;">(CustTable), </span><span style="background: white; color: darkblue; font-weight: bold;">fieldnum</span><span style="background: white;">(CustTable, CustGroup));</span></div>
<div style="font-family: consolas; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> worksheetHelper.addColumn(#BalanceMST, </span><span style="background: white; color: darkred;">"Balance MST"</span><span style="background: white;">, Types::Real);</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<br /></div>
<div style="font-family: consolas; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> </span><span style="background: white; color: darkblue; font-weight: bold;">while</span><span style="background: white;"> </span><span style="background: white; color: darkblue; font-weight: bold;">select</span><span style="background: white;"> custTable</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;"> {</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;"> currentRow
++;</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;"> worksheetHelper.setCellValue(#AccountNum,
currentRow, custTable.AccountNum);</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;"> worksheetHelper.setCellValue(#Currency,
currentRow, custTable.Currency);</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;"> worksheetHelper.setCellValue(#CustGroup,
currentRow, custTable.CustGroup);</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;"> worksheetHelper.setCellValue(#BalanceMST,
currentRow, custTable.balanceMST());</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;"> }</span></div>
<div style="font-family: consolas; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> </span><span style="background: white; color: darkblue; font-weight: bold;">if</span><span style="background: white;"> (currentRow > </span><span style="background: white; color: red; font-weight: bold;">1</span><span style="background: white;">)</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;"> {</span></div>
<div style="font-family: consolas; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> sumRow
= currentRow + </span><span style="background: white; color: red; font-weight: bold;">2</span><span style="background: white;">;</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<br /></div>
<div style="font-family: consolas; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> worksheetHelper.setCellValue(#BalanceMST,
sumRow, </span><span style="background: white; color: darkviolet;">"@SYS58659"</span><span style="background: white;">);</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<br /></div>
<div style="font-family: consolas; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> worksheetHelper.sumRange(worksheetHelper.getWorksheetRange(#BalanceMST, </span><span style="background: white; color: red; font-weight: bold;">2</span><span style="background: white;">, #BalanceMST, currentRow), #BalanceMST,
sumRow);</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<br /></div>
<div style="font-family: consolas; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> setRangeFont(#BalanceMST, </span><span style="background: white; color: red; font-weight: bold;">2</span><span style="background: white;">, #BalanceMST, currentRow, redColor);</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<br /></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;"> cellValue
= worksheet.cells().item(sumRow, #BalanceMST).value();</span></div>
<div style="font-family: consolas; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> </span><span style="background: white; color: darkblue; font-weight: bold;">if</span><span style="background: white;"> (cellValue.currency() > </span><span style="background: white; color: red; font-weight: bold;">0</span><span style="background: white;">)</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;"> {</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;"> setRangeFont(#BalanceMST,
sumRow, #BalanceMST, sumRow, redColor);</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;"> }</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;"> }</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;"> worksheetHelper.autoFitColumns();</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;"> worksheetHelper.formatWorksheetTableStyle(sysExcelHelper.getOfficeVersion());</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<br /></div>
<div style="font-family: consolas; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> </span><span style="background: white; color: green; font-style: italic;">// Generate the file
using the current UTC date time (without the ‘:’ character)</span></div>
<div style="font-family: consolas; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> </span><span style="background: white; color: green; font-style: italic;">// since it is not
allowed for file names.</span></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
fileName =
strfmt("%1%2%3", WinApi::getTempPath(),
strReplace(DateTimeUtil::toStr(DateTimeUtil::utcNow()),
":",""), sysExcelHelper.getFileExtension());</div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<br /></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;"> sysExcelHelper.save(filename);</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;"> sysExcelHelper.launchExcel();</span></div>
<div style="font-family: consolas; font-size: 9pt; margin: 0in;">
<span style="background: white;">}</span></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="background: red; font-weight: bold; mso-highlight: red;">How to get temporary
Path in AX?</span></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
WinApi::getTempPath()</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="background: red; font-style: italic; font-weight: bold; mso-highlight: red;">How
to add a new Field in Managerial Hierarchy (Workflow Approval Limits)?</span></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
In order to add a new
field in the managerial hierarchy either create a new HierarchyProvider or use
WorkflowLimitHierarchyProvider class and add new fields in it. Check the new method of
WorkflowLimitHierarchyProvider to get an
overview.</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="background: red; font-weight: bold; mso-highlight: red;">Infolog system in
Dynamics AX, how does it work?</span></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
setPrefix("Level
1");</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
Info("A");</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="background: red; font-weight: bold; mso-highlight: red;">Unbalanced TTS Begin</span></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="color: blue;">static</span> <span style="color: blue;">void</span> resetTTS(Args
_args)<br />
{<br />
<span style="color: blue;">while</span>
(appl.ttsLevel() <span style="color: #00007f;">></span> 0)<br />
<span style="color: blue;">ttsAbort</span>;<br />
}</div>
<div style="font-family: Calibri; font-size: 9pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9pt; margin: 0in;">
<span style="background: red; font-weight: bold; mso-highlight: red;">How to check if Code
is running in CIL?</span></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
Use
if(xSession::isCLRSession()) {…}</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="background: red; font-weight: bold; mso-highlight: red;">Reflection: Traverse
Projects AOT</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
static void
MSTA_Utility_ExportAllProjects(Args _args)</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
#aot</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
#properties</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
#AviFiles</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
SysOperationProgress progressBar = new SysOperationProgress();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
TreeNode _treeNode;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
TreeNode projectNode;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
TreeNodeIterator iterator;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
int i, a;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
// Initialising progress bar</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
progressBar.setCaption("Export To
Excel in progress...");</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
progressBar.setAnimation(#AviTransfer);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
_treeNode = infolog.projectRootNode();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
_treeNode = _treeNode.AOTfirstChild();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
for(i = 0; i < 2; i++)</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
iterator = _treeNode.AOTiterator();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
projectNode = iterator.next();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
while (projectNode)</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
progressBar.setText(strfmt("Project %1",
projectNode.treeNodeName()));</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
if(String::beginsWith(projectNode.treeNodeName(), "MSTA"))</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
info(projectNode.treeNodeName());</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
projectNode = iterator.next();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
a++;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
_treeNode = _treeNode.AOTnextSibling();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="background: red; font-weight: bold; mso-highlight: red;">Reflection: Traverse
Classes AOT</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
//Traverse
Class</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
static void
FindClassStartsWithXXX(Args _args)<br />
{<br />
UtilIdElements utilId;<br />
;<br />
while select utilId where
utilid.recordType == UtilElementType::Class<br />
&& utilId.name like
'XXX*'<br />
{<br />
print utilId.name;<br />
}<br />
pause;<br />
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
//Traverse
Class</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
static void
FindTablesStartsWithXXX(Args _args)</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
UtilIdElements utilId;</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
;</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
while select utilId where utilid.recordType
== UtilElementType::Table</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
&& utilId.name like 'MSTA*'</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
info(utilId.name);</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
pause;</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
//Update Class
Properties</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
static void
RenameXXXObjectsToYYY(Args _args)<br />
{<br />
TreeNode node =
TreeNode::findNode(@'\Classes\XXXClass');<br />
str oldName;<br />
str newName;<br />
#Properties<br />
;<br />
oldName =
node.AOTgetProperty(#PropertyName);<br />
newName =
strdel(oldName,1,3);<br />
node.AOTsetProperty(#PropertyName,
"YYY"+newName);<br />
node.AOTsave();<br />
node.treeNodeRelease();<br />
node = null;<br />
}</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="background: red; font-weight: bold; mso-highlight: red;">How to add database
log manually?</span></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
DatabaseLog dblog;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
ttsBegin;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
dblog.logTable = tableNum(HcmWorker);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
dblog.LogType = DatabaseLogType::Delete;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
dblog.insert();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
ttsCommit;</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9pt; margin: 0in;">
<span style="background: lime; font-weight: bold; mso-highlight: lime;">Dynamics AX
Collections</span></div>
<div style="font-family: Calibri; font-size: 9pt; margin: 0in;">
<span style="font-weight: bold;">How to create a list of records and iterate them?</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
AifAction aifAction;<br />
List actionsList = new
List(Types::Record);<br />
ListEnumerator listEnum;<br />
;<br />
<br />
if(_actionsList)<br />
{<br />
listEnum =
_actionsList.getEnumerator();<br />
while(listEnum.moveNext())<br />
{<br />
aifAction = listEnum.current();<br />
if(
aifAction.WebMethodEnabled == NoYes::No &&<br />
aifAction.WebSvcOutOfSync
== NoYes::Yes &&<br />
aifAction.ErrorState ==
AifServiceGenerationErrorState::WebServiceOutOfSyncError &&<br />
aifAction.Intercompany ==
NoYes::No)<br />
{<br />
actionsList.addEnd(aifAction);<br />
}<br />
}<br />
}</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic; font-weight: bold;">How to convert real numbers to time
format</span></div>
<div style="color: #222222; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white;">public static str 5 num2Time(real _hours)</span></div>
<div style="color: #222222; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white;">{</span></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="color: #222222; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> int realPart;</span></div>
<div style="color: #222222; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> int decimalPart;</span></div>
<div style="color: #222222; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> real hours;</span></div>
<div style="color: #222222; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> str hoursStr;</span></div>
<div style="color: #222222; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> str minStr;</span></div>
<div style="color: #222222; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> int decimalLocation;</span></div>
<div style="color: #222222; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> str finalMinutes;</span></div>
<div style="color: #222222; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> ;</span></div>
<div style="color: #222222; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> try</span></div>
<div style="color: #222222; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> {</span></div>
<div style="color: #222222; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> hours =
_hours;</span></div>
<div style="color: #222222; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> hoursStr =
num2str(hours, 0, 2, 1, 0);</span></div>
<div style="color: #222222; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white;">
decimalLocation = strfind(hoursStr, ".", 0, strlen(hoursStr));</span></div>
<div style="color: #222222; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> hoursStr =
substr(hoursStr, 0, decimalLocation);</span></div>
<div style="color: #222222; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> hoursStr =
trimString(hoursStr, ["."]);</span></div>
<div style="color: #222222; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> minStr =
num2str(hours, 0, 2, 1, 0);</span></div>
<div style="color: #222222; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> minStr =
substr(minStr, decimalLocation, strlen(minStr) - strlen(hoursStr));</span></div>
<div style="color: #222222; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> minStr =
trimString(minStr, ["."]);</span></div>
<div style="color: #222222; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> realPart =
str2int(hoursStr);</span></div>
<div style="color: #222222; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> decimalPart
= str2int(minStr);</span></div>
<div style="color: #222222; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white;">
finalMinutes = hoursStr + ":" + (int2str(60 * decimalPart / 100) ==
"0" ? "00" : int2str(60 * decimalPart / 100));</span></div>
<div style="color: #222222; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> return
finalMinutes;</span></div>
<div style="color: #222222; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> }</span></div>
<div style="color: #222222; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> catch</span></div>
<div style="color: #222222; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> {</span></div>
<div style="color: #222222; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> return
num2str(_hours, 0, 2, 1, 0);</span></div>
<div style="color: #222222; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white;"> }</span></div>
<div style="color: #222222; font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<span style="background: white;">}</span></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
strFmt("%1:%2",
hours div 1, strRfix(int2str(round(abs(hours)*60,1) mod 60),2,"0"))</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="color: #595959; font-family: Calibri; font-size: 9.0pt; margin: 0in;">
From
<<a href="http://msdax.blogspot.com.au/2011/06/converting-real-number-to-time.html">http://msdax.blogspot.com.au/2011/06/converting-real-number-to-time.html</a>>
</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="background: red; font-style: italic; font-weight: bold; mso-highlight: red;">SQL
Server: Identifying and Killing Blocking Transactions</span></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
SELECT</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
db.name DBName,</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
tl.request_session_id,</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
wt.blocking_session_id,</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
OBJECT_NAME(p.OBJECT_ID) BlockedObjectName,</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
tl.resource_type,</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
h1.TEXT
AS RequestingText,</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
h2.TEXT
AS BlockingTest,</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
tl.request_mode</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
FROM sys.dm_tran_locks AS tl</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
INNER
JOIN sys.databases
db ON db.database_id =tl.resource_database_id</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
INNER
JOIN sys.dm_os_waiting_tasks AS wt ON tl.lock_owner_address =wt.resource_address</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
INNER
JOIN sys.partitions AS p ON p.hobt_id =tl.resource_associated_entity_id</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
INNER
JOIN sys.dm_exec_connections
ec1 ON ec1.session_id =tl.request_session_id</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
INNER
JOIN sys.dm_exec_connections
ec2 ON ec2.session_id =wt.blocking_session_id</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
CROSS APPLY
sys.dm_exec_sql_text(ec1.most_recent_sql_handle) AS h1</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
CROSS APPLY
sys.dm_exec_sql_text(ec2.most_recent_sql_handle) AS h2</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
GO</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
KILL <blocking spid=""></blocking></div>
<div style="color: #595959; font-family: Calibri; font-size: 9.0pt; margin: 0in;">
From
<<a href="http://blog.sqlauthority.com/2010/10/06/sql-server-quickest-way-to-identify-blocking-query-and-resolution-dirty-solution/">http://blog.sqlauthority.com/2010/10/06/sql-server-quickest-way-to-identify-blocking-query-and-resolution-dirty-solution/</a>>
</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9pt; margin: 0in;">
<span style="background: red; font-style: italic; font-weight: bold; mso-highlight: red;">How
to Assign temporary table to Grid?</span></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
Grid.setTmpData(temporaryTabeReference);</div>
<div style="font-family: Calibri; font-size: 9pt; margin: 0in;">
<br /></div>
<div style="color: #595959; font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div lang="en-US" style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="background: red; font-weight: bold; mso-highlight: red;">Lookups</span></div>
<div lang="en-US" style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="background: red; font-style: italic; font-weight: bold; mso-highlight: red;">How
to create simple lookup?</span></div>
<div lang="en-US" style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
Simple
lookups can easily be created by adding a relation between the tables.</div>
<div lang="en-US" style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div lang="en-US" style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="background: red; font-style: italic; font-weight: bold; mso-highlight: red;">How
to create a dynamic lookup?</span></div>
<div lang="en-US" style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
In order
to create a dynamic lookup there are two steps,</div>
<div lang="en-US" style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
Step1:
Create a lookup method in table or class</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
public static
void lookupVendorByCurrency(</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
FormControl _callingControl,</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
CurrencyCode _currency)</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
Query query;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
QueryBuildDataSource qbds;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
QueryBuildRange qbr;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
SysTableLookup lookup;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
query = new Query();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
qbds =
query.addDataSource(tableNum(VendTable));</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
qbr = qbds.addRange(fieldNum(VendTable,
Currency));</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
qbr.value(queryvalue(_currency));</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
lookup =
SysTableLookup::newParameters(tableNum(VendTable), _callingControl, true);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
lookup.parmQuery(query);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
lookup.addLookupField(fieldNum(VendTable,
AccountNum), true);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
lookup.addLookupField(fieldNum(VendTable,Party));</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
lookup.addLookupField(fieldNum(VendTable,Currency));</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
lookup.performFormLookup();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div lang="en-US" style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div lang="en-US" style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
Step2:
Call the lookup method from the overridden lookup method on the data source
field</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
public void
lookup(FormControl _formControl, str _filterStr)</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
VendTable::lookupVendorByCurrency(_formControl, CustTable.Currency);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="background: red; font-weight: bold; mso-highlight: red;">Display Method
Caching</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
Display methods
must be written at table levels, in AX 2012 you can also use cache display
method property of form controls.</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
CustTable_ds.cacheAddMethod(tableMethodStr(CustTable,
name), false);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="background: red; font-weight: bold; mso-highlight: red;">How to implement
multi-threading in AX ?</span></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="background: red; font-weight: bold; mso-highlight: red;">How to Place a new
line character in a Label?</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
Use info(strFmtLB("@Label"));</div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="font-style: italic; font-weight: bold;">How to change the splash screen for
AX?</span></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<a href="http://www.axaptapedia.com/Changing_Splashscreen">http://www.axaptapedia.com/Changing_Splashscreen</a></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="background: red; font-weight: bold; mso-highlight: red;">How to check
configuration key?</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
if
(isConfigurationkeyEnabled(configurationKeyNum('MSTARails')))</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<span style="background: red; font-weight: bold; mso-highlight: red;">How to create a new
number sequence in AX 2012?</span></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
1. Create an edt : CarId .</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
AOT >>
Extended Datatype</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
2. Write a code
on lode module() on NumberSeqModuleProject</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
datatype.parmDatatypeId(extendedTypeNum(Car Id));</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
datatype.parmReferenceHelp(literalStr("@SYS334483"));</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
datatype.parmWizardIsManual(NoYes::No);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
datatype.parmWizardIsChangeDownAllowed(NoYes::No);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
datatype.parmWizardIsChangeUpAllowed(NoYes::No);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
datatype.parmWizardHighest(999999);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
datatype.parmSortField(20);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
datatype.addParameterType(NumberSeqParameterType::DataArea, true,
false);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
this.create(datatype);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
3.Write a
method on Projparameters Table</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
client server
static NumberSequenceReference numRefcarId()</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
return
NumberSeqReference::findReference(extendedTypeNum(car Id));</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
4.Write a job
and run that</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
static void
Carid(Args _args)</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
NumberSeqModuleProject NumberSeqModuleProject = new
NumberSeqModuleProject();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
NumberSeqModuleProject.load();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
5. Then run the
wizard</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
Organization
Administration >> CommonForms >>
Numbersequences>>Numbersequences>> Generate >> run the
wizard.</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
6.Now we have
to check the number sequence is
correctly working for that write a job:</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
static void
number(Args _args)</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
NumberSeq
numberSeq;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
CarId num;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
numberSeq =
NumberSeq::newGetNum(ProjParameters::numRefcarId());</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
num = numberSeq.num();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
info(num);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
Run the above
job.We will find the generated Number
sequence.
.</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
7. Now we want
that Number Sequence in form level(Car Table):</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
Declare the
number sequence On Form Declaration:</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
public class
FormRun extends ObjectRun</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
NumberSeqFormHandler numberSeqFormHandler;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
8. Write the
NumberSeqFormHandler() in form methods node.</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
NumberSeqFormHandler
numberSeqFormHandler()</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
if (!numberSeqFormHandler)</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
numberSeqFormHandler =
NumberSeqFormHandler::newForm(ProjParameters::numRefcarId ().NumberSequenceId,</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
element,</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
CarTable_DS,</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
fieldNum(CarTable, Car Id)</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
return numberSeqFormHandler;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
9.Write the
close() on the form methods node.</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
void close()</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
if (numberSeqFormHandler)</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
numberSeqFormHandler.formMethodClose();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
super();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
10. Then final
add the below methods on data source methods node</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
Create()</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
void
create(boolean append = false,</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
boolean extern = false) // If created externally</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
element.numberSeqFormHandler().formMethodDataSourceCreatePre();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
super(append);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
if (!extern)</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
element.numberSeqFormHandler().formMethodDataSourceCreate(true);</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
Delete()</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
public void
delete()</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
element.numberSeqFormHandler().formMethodDataSourceDelete();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
super();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
Write()</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
public void
write()</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
super();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
element.numberSeqFormHandler().formMethodDataSourceWrite();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
Validate
Write()</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
public boolean
validateWrite()</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
boolean ret;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
ret = super();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
ret =
element.numberSeqFormHandler().formMethodDataSourceValidateWrite(ret)
&& ret;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
if (ret)</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
CarTable.validateWrite();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
return ret;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
Link Active()</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
public void
linkActive()</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
{</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
;</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
element.numberSeqFormHandler().formMethodDataSourceLinkActive();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
super();</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
}</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
Now our
numberseqence is generated .</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
*** Set the
field or Tabpage Allowedit property to No.</div>
<div style="font-family: "Courier New"; font-size: 9.0pt; margin: 0in;">
***Check the
continues on wizard.</div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
<br />
<div style="font-family: Calibri; font-size: 9.0pt; margin: 0in;">
<br /></div>
</div>
Unknownnoreply@blogger.com66tag:blogger.com,1999:blog-3914734843767545698.post-4787934919754443502014-07-14T22:34:00.002-07:002014-07-14T22:34:16.736-07:00Getting a list of all projects<div dir="ltr" style="text-align: left;" trbidi="on">
Question: How can i get a list of all projects in a system?<br />
<br />
Answer: Use the code snippet below,<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">static void MSTA_Utility_ExportAllProjects(Args _args)</span><br />
<span style="font-family: Courier New, Courier, monospace;">{</span><br />
<span style="font-family: Courier New, Courier, monospace;"> #aot</span><br />
<span style="font-family: Courier New, Courier, monospace;"> #properties</span><br />
<span style="font-family: Courier New, Courier, monospace;"> #AviFiles</span><br />
<span style="font-family: Courier New, Courier, monospace;"> SysOperationProgress progressBar = new SysOperationProgress();</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> TreeNode _treeNode;</span><br />
<span style="font-family: Courier New, Courier, monospace;"> TreeNode projectNode;</span><br />
<span style="font-family: Courier New, Courier, monospace;"> TreeNodeIterator iterator;</span><br />
<span style="font-family: Courier New, Courier, monospace;"> int i, a;</span><br />
<span style="font-family: Courier New, Courier, monospace;"> // Initialising progress bar</span><br />
<span style="font-family: Courier New, Courier, monospace;"> progressBar.setCaption("Export To Excel in progress...");</span><br />
<span style="font-family: Courier New, Courier, monospace;"> progressBar.setAnimation(#AviTransfer);</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> _treeNode = infolog.projectRootNode();</span><br />
<span style="font-family: Courier New, Courier, monospace;"> _treeNode = _treeNode.AOTfirstChild();</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> for(i = 0; i < 2; i++)</span><br />
<span style="font-family: Courier New, Courier, monospace;"> {</span><br />
<span style="font-family: Courier New, Courier, monospace;"> iterator = _treeNode.AOTiterator();</span><br />
<span style="font-family: Courier New, Courier, monospace;"> projectNode = iterator.next();</span><br />
<span style="font-family: Courier New, Courier, monospace;"> while (projectNode)</span><br />
<span style="font-family: Courier New, Courier, monospace;"> {</span><br />
<span style="font-family: Courier New, Courier, monospace;"> progressBar.setText(strfmt("Project %1", projectNode.treeNodeName()));</span><br />
<span style="font-family: Courier New, Courier, monospace;"> if(String::beginsWith(projectNode.treeNodeName(), "MSTA"))</span><br />
<span style="font-family: Courier New, Courier, monospace;"> {</span><br />
<span style="font-family: Courier New, Courier, monospace;"> info(projectNode.treeNodeName()) ;</span><br />
<span style="font-family: Courier New, Courier, monospace;"> }</span><br />
<span style="font-family: Courier New, Courier, monospace;"> projectNode = iterator.next();</span><br />
<span style="font-family: Courier New, Courier, monospace;"> a++;</span><br />
<span style="font-family: Courier New, Courier, monospace;"> }</span><br />
<span style="font-family: Courier New, Courier, monospace;"> _treeNode = _treeNode.AOTnextSibling();</span><br />
<span style="font-family: Courier New, Courier, monospace;"> }</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">}</span></div>
Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-3914734843767545698.post-81208366889476256232013-06-17T18:59:00.001-07:002013-06-17T18:59:22.747-07:00Database Diagrams for AX 2012 R2! - Microsoft Dynamics AX Support - Site Home - MSDN Blogs<a href="http://blogs.msdn.com/b/axsupport/archive/2013/05/23/database-diagrams-for-ax-2012-r2.aspx">Database Diagrams for AX 2012 R2! - Microsoft Dynamics AX Support - Site Home - MSDN Blogs</a>: "Database Diagrams for AX 2012 R2!"<br />
<br />
<a href="https://chrome.google.com/webstore/detail/pengoopmcjnbflcjbmoeodbmoflcgjlk" style="font-size: 13px;">'via Blog this'</a>Unknownnoreply@blogger.com5tag:blogger.com,1999:blog-3914734843767545698.post-36589932517230487442013-05-16T16:36:00.003-07:002013-05-16T16:36:23.480-07:00Object Server 01: The license information can not be decoded. <div dir="ltr" style="text-align: left;" trbidi="on">
<b><span style="font-family: Verdana, sans-serif;">Question:</span></b><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">AX 2012 AOS Service is not starting and I am getting the following error</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<b><i><span style="font-family: Verdana, sans-serif;">"Object Server 01: The license information can not be decoded. "</span></i></b><br />
<b><i><span style="font-family: Verdana, sans-serif;"><br /></span></i></b>
<span style="font-family: Verdana, sans-serif;"><b>Answer:</b></span><br />
<span style="font-family: Verdana, sans-serif;">This is mainly because of permissions, I gave admin rights to AOS service account and it worked. </span></div>
Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-3914734843767545698.post-62420627572571656552013-05-05T21:42:00.000-07:002013-05-05T21:42:15.464-07:00data or calculated fields with type 'Record' are not supported<div dir="ltr" style="text-align: left;" trbidi="on">
<b>Question:</b><br />
I am getting an error "data or calculated fields with type 'Record' are not supported".<br />
<br />
<b>Answer:</b><br />
Make sure the table and all related tables does not have any display method returning a record.</div>
Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-3914734843767545698.post-76744068148761626722013-05-05T16:50:00.001-07:002013-05-05T16:50:18.482-07:00Keyboad Mapper<div dir="ltr" style="text-align: left;" trbidi="on">
http://sharpkeys.codeplex.com/</div>
Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-3914734843767545698.post-53337509423285473542013-04-02T21:41:00.001-07:002013-04-02T21:42:35.569-07:00Dynamics AX 2009 Report libraries to Dynamics AX 2012 SSRS Reports<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
<span style="font-size: x-small;"><b><span style="font-family: Verdana, sans-serif;">Question:</span></b><span style="font-family: Verdana, sans-serif;">How can i convert my Dynamics AX 2009 reporting libraries to be usable in Dynamics AX 2012?</span><b><span style="font-family: Verdana, sans-serif;">Answer:</span></b><span style="font-family: Verdana, sans-serif;">In order to use the Reporting Libraries from 2009 in 2012 use the following steps,</span><span style="font-family: Verdana, sans-serif;">1- Use the upgrade reports command line that comes with AX 2012 , normally located at <span style="color: #2a2a2a; line-height: 18px;">C:\Program Files\Microsoft Dynamics AX\60\tools, to upgrade the reporting libraries to current format.</span></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-3kbec_MHstA/UVuxuRqpzSI/AAAAAAAAAq8/SI23iqw7o_o/s1600/Capture.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="313" src="http://2.bp.blogspot.com/-3kbec_MHstA/UVuxuRqpzSI/AAAAAAAAAq8/SI23iqw7o_o/s640/Capture.PNG" width="640" /></a></div>
<div style="text-align: left;">
<span style="font-size: x-small;"><span style="font-family: Verdana, sans-serif;"><span style="color: #2a2a2a; line-height: 18px;"><br /></span></span><span style="color: #2a2a2a; line-height: 18px;"><span style="font-family: Verdana, sans-serif;">2- Open the business logic project created after the step above , compile and add the business logic to AOT.</span></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-UJ-PuhZ-azQ/UVuyCgVuZaI/AAAAAAAAArE/vekmWFd1i0I/s1600/Capture.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="604" src="http://3.bp.blogspot.com/-UJ-PuhZ-azQ/UVuyCgVuZaI/AAAAAAAAArE/vekmWFd1i0I/s640/Capture.PNG" width="640" /></a></div>
<div style="text-align: left;">
<span style="font-size: x-small;"><span style="color: #2a2a2a; line-height: 18px;"><span style="font-family: Verdana, sans-serif;"><br /></span></span></span></div>
<div style="text-align: left;">
<span style="font-size: x-small;"><span style="font-family: Verdana, sans-serif;"><span style="color: #2a2a2a;"><span style="line-height: 18px;">3- Open the reporting project and change the business logic to be using the new business logic.</span></span></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-En33Sgv8shA/UVuymojPudI/AAAAAAAAArM/z8nqtlrGpbc/s1600/Capture.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="110" src="http://2.bp.blogspot.com/-En33Sgv8shA/UVuymojPudI/AAAAAAAAArM/z8nqtlrGpbc/s640/Capture.PNG" width="640" /></a></div>
<div style="text-align: left;">
<span style="font-size: x-small;"><span style="font-family: Verdana, sans-serif;"><span style="color: #2a2a2a;"><span style="line-height: 18px;"><br /></span></span></span></span></div>
<div style="text-align: left;">
<span style="font-size: x-small;"><span style="font-family: Verdana, sans-serif;"><span style="color: #2a2a2a;"><span style="line-height: 18px;"><br /></span></span></span></span></div>
<div style="text-align: left;">
<span style="font-size: x-small;"><span style="font-family: Verdana, sans-serif;"><span style="color: #2a2a2a;"><span style="line-height: 18px;">4- Compile the project, add to AOT and deploy to SSRS.</span></span></span></span><br />
<span style="font-size: x-small;"><span style="font-family: Verdana, sans-serif;"><span style="color: #2a2a2a;"><span style="line-height: 18px;"><br /></span></span></span></span>
<span style="font-size: x-small;"><span style="font-family: Verdana, sans-serif;"><span style="color: #2a2a2a;"><span style="line-height: 18px;"><b>Other Links</b></span></span></span></span><br />
<span style="font-size: x-small;"><span style="font-family: Verdana, sans-serif;"><span style="color: #2a2a2a;"><span style="line-height: 18px;">1-</span></span></span></span><span style="color: #2a2a2a; font-family: Verdana, sans-serif; font-size: x-small;"><span style="line-height: 18px;">http://technet.microsoft.com/EN-US/library/hh292607.aspx</span></span><br />
<span style="color: #2a2a2a; font-family: Verdana, sans-serif; font-size: x-small;"><span style="line-height: 18px;">2- http://technet.microsoft.com/en-us/library/hh292607.aspx</span></span></div>
</div>
Unknownnoreply@blogger.com4tag:blogger.com,1999:blog-3914734843767545698.post-8366248540860269902012-11-06T21:29:00.001-08:002012-11-06T21:29:41.164-08:00Mindbrations: AX2012 - How to control the visibility of FactBox on form thru X++<a href="http://mindbrations.blogspot.com.au/2012/06/ax2012-how-to-control-visibility-of.html">Mindbrations: AX2012 - How to control the visibility of FactBox on form thru X++</a>: "AX2012 - How to control the visibility of FactBox on form thru X++"<br />
<br />
<a href="https://chrome.google.com/webstore/detail/pengoopmcjnbflcjbmoeodbmoflcgjlk" style="font-size: 13px;">'via Blog this'</a>Unknownnoreply@blogger.com28tag:blogger.com,1999:blog-3914734843767545698.post-42099230603861990922012-10-24T21:54:00.003-07:002012-10-24T23:17:12.177-07:00Print Main Menu<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Verdana, sans-serif;">Question: How can i print all elements of a main menu.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Answer: Use the following job, </span><br />
<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">static void menuPrint(Args _args)</span><br />
<span style="font-family: Courier New, Courier, monospace;">{</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> SysDictMenu menu;</span><br />
<span style="font-family: Courier New, Courier, monospace;"> SysExcelWorksheetHelper worksheetHelper;</span><br />
<span style="font-family: Courier New, Courier, monospace;"> SysExcelHelper sysExcelHelper;</span><br />
<span style="font-family: Courier New, Courier, monospace;"> SysExcelWorksheet worksheet;</span><br />
<span style="font-family: Courier New, Courier, monospace;"> str menuToPrint;</span><br />
<span style="font-family: Courier New, Courier, monospace;"> str worksheetName;</span><br />
<span style="font-family: Courier New, Courier, monospace;"> int currentRow = 1;</span><br />
<span style="font-family: Courier New, Courier, monospace;"> str fileName;</span><br />
<span style="font-family: Courier New, Courier, monospace;"> str path;</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> void reportLevel(SysDictMenu _sysDictMenu)</span><br />
<span style="font-family: Courier New, Courier, monospace;"> {</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> SysMenuEnumerator enumerator;</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> if(_sysDictMenu.isMenuReference() || _sysDictMenu.isMenu())</span><br />
<span style="font-family: Courier New, Courier, monospace;"> {</span><br />
<span style="font-family: Courier New, Courier, monospace;"> path += _sysDictMenu.label() + "//";</span><br />
<span style="font-family: Courier New, Courier, monospace;"> enumerator = _sysDictMenu.getEnumerator();</span><br />
<span style="font-family: Courier New, Courier, monospace;"> while (enumerator.moveNext())</span><br />
<span style="font-family: Courier New, Courier, monospace;"> {</span><br />
<span style="font-family: Courier New, Courier, monospace;"> reportLevel(enumerator.current());</span><br />
<span style="font-family: Courier New, Courier, monospace;"> }</span><br />
<span style="font-family: Courier New, Courier, monospace;"> }</span><br />
<span style="font-family: Courier New, Courier, monospace;"> else</span><br />
<span style="font-family: Courier New, Courier, monospace;"> { currentRow ++;</span><br />
<span style="font-family: Courier New, Courier, monospace;"> worksheetHelper.setCellValue(2, currentRow, _sysDictMenu.label());</span><br />
<span style="font-family: Courier New, Courier, monospace;"> path = "";</span><br />
<span style="font-family: Courier New, Courier, monospace;"> }</span><br />
<span style="font-family: Courier New, Courier, monospace;"> }</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> ;</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> sysExcelHelper = SysExcelHelper::construct();</span><br />
<span style="font-family: Courier New, Courier, monospace;"> sysExcelHelper.initialize();</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> menuToPrint = 'Roster';</span><br />
<span style="font-family: Courier New, Courier, monospace;"> worksheetName = menuToPrint;</span><br />
<span style="font-family: Courier New, Courier, monospace;"> worksheet = sysExcelHelper.addWorksheet(worksheetName);</span><br />
<span style="font-family: Courier New, Courier, monospace;"> worksheetHelper = SysExcelWorksheetHelper::construct(worksheet);</span><br />
<span style="font-family: Courier New, Courier, monospace;"> // Populate the header row with the appropriate field labels and format the columns</span><br />
<span style="font-family: Courier New, Courier, monospace;"> worksheetHelper.addColumn(1, "Path", Types::String);</span><br />
<span style="font-family: Courier New, Courier, monospace;"> worksheetHelper.addColumn(2, "Item", Types::String);</span><br />
<span style="font-family: Courier New, Courier, monospace;"> worksheetHelper.addColumn(3, "Status", Types::String);</span><br />
<span style="font-family: Courier New, Courier, monospace;"> worksheetHelper.addColumn(4, "Assigned To", Types::String);</span><br />
<span style="font-family: Courier New, Courier, monospace;"> worksheetHelper.addColumn(5, "Notes", Types::String);</span><br />
<span style="font-family: Courier New, Courier, monospace;"> reportLevel(SysDictMenu::newMenuName(MenuStr(Roster)));</span><br />
<span style="font-family: Courier New, Courier, monospace;"> worksheetHelper.autoFitColumns();</span><br />
<span style="font-family: Courier New, Courier, monospace;"> worksheetHelper.formatWorksheetTableStyle(sysExcelHelper.getOfficeVersion());</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> // Generate the file using the current UTC date time (without the ‘:’ character)</span><br />
<span style="font-family: Courier New, Courier, monospace;"> // since it is not allowed for file names.</span><br />
<span style="font-family: Courier New, Courier, monospace;"> fileName = "C:\\Windows\\Temp\\ExportToExcel.xlsx";</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> sysExcelHelper.save(filename);</span><br />
<span style="font-family: Courier New, Courier, monospace;"> sysExcelHelper.launchExcel();</span><br />
<div>
<span style="font-family: Courier New, Courier, monospace;">}</span></div>
</div>
Unknownnoreply@blogger.com497tag:blogger.com,1999:blog-3914734843767545698.post-74069417057750728512012-08-28T21:32:00.001-07:002012-08-28T21:32:30.148-07:00Read / Write Files from document handling <div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Verdana, sans-serif;"><b>Question:</b></span><br />
<span style="font-family: Verdana, sans-serif;">How can you read / writes files from document handling?</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><b>Answer:</b></span><br />
<br />
<div style="background-color: white; border: 0px; color: #333333; font-size: 14px; line-height: 21px; margin-bottom: 1.429em; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="font-family: Courier New, Courier, monospace;">void fromFolderToDB(FilePath _path)<br />{<br />System.IO.DirectoryInfo dir = new<br />System.IO.DirectoryInfo(_path);<br />System.IO.FileInfo[] files;<br />System.IO.FileInfo curFile;<br />System.Collections.IEnumerator enumerator;</span></div>
<div style="background-color: white; border: 0px; color: #333333; font-size: 14px; line-height: 21px; margin-bottom: 1.429em; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="font-family: Courier New, Courier, monospace;">BinData binData;</span></div>
<div style="background-color: white; border: 0px; color: #333333; font-size: 14px; line-height: 21px; margin-bottom: 1.429em; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="font-family: Courier New, Courier, monospace;">DocuValue docuValue;</span></div>
<div style="background-color: white; border: 0px; color: #333333; font-size: 14px; line-height: 21px; margin-bottom: 1.429em; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="font-family: Courier New, Courier, monospace;">;<br />files = dir.GetFiles(_path);<br />enumerator = files.GetEnumerator();<br />while (enumerator.MoveNext())<br />{<br />curFile = enumerator.get_Current();</span></div>
<div style="background-color: white; border: 0px; color: #333333; font-size: 14px; line-height: 21px; margin-bottom: 1.429em; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="font-family: Courier New, Courier, monospace;">docuValue.clear();</span></div>
<div style="background-color: white; border: 0px; color: #333333; font-size: 14px; line-height: 21px; margin-bottom: 1.429em; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="font-family: Courier New, Courier, monospace;">binData.loadFile(curFile.get_FullName()); // get file content</span></div>
<div style="background-color: white; border: 0px; color: #333333; font-size: 14px; line-height: 21px; margin-bottom: 1.429em; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="font-family: Courier New, Courier, monospace;">docuValue.File = binData.getData();<br />docuValue.FileName = curFile.get_Name();<br />docuValue.insert(); // insert into DB<br />}<br />}</span></div>
<div style="background-color: white; border: 0px; color: #333333; font-size: 14px; line-height: 21px; margin-bottom: 1.429em; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="font-family: Courier New, Courier, monospace;">void fromDBToFolder(FilePath _path)<br />{<br />BinData binData;<br />DocuValue docuValue;</span></div>
<div style="background-color: white; border: 0px; color: #333333; font-size: 14px; line-height: 21px; margin-bottom: 1.429em; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="font-family: Courier New, Courier, monospace;">;<br />while select docuValue // load From DB<br />{<br />binData.setData(docuValue.File);<br />binData.saveFile(docuValue.FileName); // insert into file system<br />}<br />}</span></div>
<div style="background-color: white; border: 0px; color: #333333; font-size: 14px; line-height: 21px; margin-bottom: 1.429em; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="font-family: Verdana, sans-serif;">Make attention to CodeAccessPermission when reading/writing to file system<br />and when using CLR inside X++</span></div>
</div>
Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-3914734843767545698.post-29714081570943242672012-08-27T18:51:00.001-07:002012-08-27T18:51:09.859-07:00Error "Cannot access a disposed object" when deploying AX 2009 Enterprise Portal on a SharePoint 2010 server - Microsoft Dynamics AX Technical Support Blog - Site Home - MSDN Blogs<a href="http://blogs.msdn.com/b/emeadaxsupport/archive/2010/10/01/error-quot-cannot-access-a-disposed-object-quot-when-deploying-ax-2009-enterprise-portal-on-a-sharepoint-2010-server.aspx">Error "Cannot access a disposed object" when deploying AX 2009 Enterprise Portal on a SharePoint 2010 server - Microsoft Dynamics AX Technical Support Blog - Site Home - MSDN Blogs</a>: <br />
<br />
<a href="https://chrome.google.com/webstore/detail/pengoopmcjnbflcjbmoeodbmoflcgjlk" style="font-size: 13px;">'via Blog this'</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3914734843767545698.post-23398270040562429672012-08-13T21:02:00.003-07:002012-08-13T21:02:48.905-07:00CAL License or Server License for SQL Server in AX Environment<div dir="ltr" style="text-align: left;" trbidi="on">
<b><span style="font-family: Verdana, sans-serif;">Question</span></b><br />
<span style="font-family: Verdana, sans-serif;">Should we use CAL based licensing or server based licensing for SQL Server in AX Environment?</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<b><span style="font-family: Verdana, sans-serif;">Answer</span></b><br />
<span style="font-family: Verdana, sans-serif;">Please read the link from <a href="http://www.google.com.au/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CGUQFjAA&url=http%3A%2F%2Fdownload.microsoft.com%2Fdownload%2F3%2FD%2F7%2F3D7C4FAC-A971-4078-9909-E05EB619EE7F%2FDynamics_AX_2012_Licensing_Guide_CustomerEdition.pdf&ei=Js0pULf5KLCPiAf93IEw&usg=AFQjCNGuzZEpU_5wtzgJk3Hih3VODiIVng&sig2=z0FM97t2hUBmh_AW9FHtYg">here</a>. </span></div>
Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-3914734843767545698.post-8268340707052136912012-08-01T19:34:00.000-07:002012-08-01T19:34:20.769-07:00Matching Invoices to Portions of a Packing Slip<div dir="ltr" style="text-align: left;" trbidi="on">
<b><span style="font-family: Verdana, sans-serif;">Question</span></b><br />
<span style="font-family: Verdana, sans-serif;">Is there any way to find out invoices corresponding to individual packing slips</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span><br />
<b><span style="font-family: Verdana, sans-serif;">Answer</span></b><br />
<span style="font-family: Verdana, sans-serif;">There is a link between <b><i>InventTrans</i></b>, <b><i>CustInvoiceJourn</i></b> and <b><i>CustPackingSlipJour</i></b>. This can be used to get the desired result. Also read <a href="http://www.microsoft.com/en-us/download/details.aspx?id=23769">this </a>document.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span><br />
<span style="font-family: Verdana, sans-serif;"><b>Links</b></span><br />
<a href="http://www.microsoft.com/en-us/download/details.aspx?id=23769"><span style="font-family: Verdana, sans-serif;">http://www.microsoft.com/en-us/download/details.aspx?id=23769</span></a>
</div>Unknownnoreply@blogger.com4tag:blogger.com,1999:blog-3914734843767545698.post-42307926882269301612012-07-26T23:34:00.000-07:002012-07-26T23:34:51.211-07:00Sending email through outlook in Dynamics AX<div dir="ltr" style="text-align: left;" trbidi="on">
<b>Question:</b><br />
How can i send an email in AX through outlook?<br />
<br />
<b>Answer:</b><br />
<br />
static void OutlookEmail(Args _args)<br />
{<br />
SmmOutlookEmail smmOutlookEmail = new SmmOutlookEmail();<br />
<br />
;<br />
if (smmOutlookEmail.createMailItem())<br />
{<br />
smmOutlookEmail.addEMailRecipient('asamad@moorestephens.com.au');<br />
smmOutlookEmail.addSubject("Test");<br />
smmOutlookEmail.isHTML(true);<br />
smmOutlookEmail.addBodyText('Test');<br />
smmOutlookEmail.sendEMail(smmSaveCopyofEmail::No);<br />
}<br />
}<br />
</div>Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-3914734843767545698.post-12557311845662855982012-07-24T02:10:00.001-07:002012-07-24T02:10:09.237-07:00Dynamics AX (2009 & 2012): How to get On-Hand inventory of past years (by date)<a href="http://dynamicsax-world.blogspot.com.au/2011/05/how-to-get-on-hand-inventory-of-past.html">Dynamics AX (2009 & 2012): How to get On-Hand inventory of past years (by date)</a>: "How to get On-Hand inventory of past years (by date)"<br />
<br />
<a href="https://chrome.google.com/webstore/detail/pengoopmcjnbflcjbmoeodbmoflcgjlk" style="font-size: 13px;">'via Blog this'</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3914734843767545698.post-28859227076019035502012-07-23T21:59:00.001-07:002012-07-23T21:59:53.356-07:00Re: AXADOMD is not installed error. - Microsoft Dynamics AX Forum - Microsoft Dynamics AX - Microsoft Dynamics Community<a href="http://community.dynamics.com/product/ax/f/33/p/68960/132103.aspx">Re: AXADOMD is not installed error. - Microsoft Dynamics AX Forum - Microsoft Dynamics AX - Microsoft Dynamics Community</a>: "AXADOMD is not installed error"<br />
<br />
<a href="https://chrome.google.com/webstore/detail/pengoopmcjnbflcjbmoeodbmoflcgjlk" style="font-size: 13px;">'via Blog this'</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3914734843767545698.post-35992818810736943332012-07-22T16:55:00.001-07:002012-07-22T16:55:14.053-07:00David Sandor | SOLVED: You must install SQL Server 2005 Analysis Services with Service Pack 2 or higher before installing the Analysis extensions.<a href="http://davidsandor.com/post/2009/07/17/SOLVED-You-must-install-SQL-Server-2005-Analysis-Services-with-Service-Pack-2-or-higher-before-installing-the-Analysis-extensions.aspx">David Sandor | SOLVED: You must install SQL Server 2005 Analysis Services with Service Pack 2 or higher before installing the Analysis extensions.</a>: "You must install SQL Server 2005 Analysis Services with Service Pack 2 or higher before installing the Analysis extensions."<br />
<br />
<a href="https://chrome.google.com/webstore/detail/pengoopmcjnbflcjbmoeodbmoflcgjlk" style="font-size: 13px;">'via Blog this'</a>Unknownnoreply@blogger.com17tag:blogger.com,1999:blog-3914734843767545698.post-88646552701293427842012-07-19T19:56:00.001-07:002012-07-19T19:56:44.487-07:00AxUpdatePortal not working with SharePoint 2010<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
<b><span style="font-family: Verdana, sans-serif;">Question:</span></b></div>
<div style="text-align: left;">
<span style="font-family: Verdana, sans-serif;">When trying to deploy files using <b><i>AxUpdatePortal </i></b>utility in a SharePoint 2010 environment, the utility is not working at all.</span></div>
<div style="text-align: left;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div style="text-align: left;">
<b><span style="font-family: Verdana, sans-serif;">Answer:</span></b></div>
<div style="text-align: left;">
<span style="font-family: Verdana, sans-serif;">Make sure you have completed all the steps mentioned in the <a href="https://mbs2.microsoft.com/Knowledgebase/KBDisplay.aspx?scid=kb;en-US;2278963"><b><i>KB <span style="background-color: white;">2278963.</span></i></b></a></span></div>
</div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3914734843767545698.post-71273736245776358542012-07-18T22:36:00.001-07:002012-07-18T22:36:26.560-07:00Server wallpaper with configuration info<a href="http://technet.microsoft.com/en-us/sysinternals/bb897557.aspx">BgInfo</a>: "BgInfo v4.16"<br />
<br />
<a href="https://chrome.google.com/webstore/detail/pengoopmcjnbflcjbmoeodbmoflcgjlk" style="font-size: 13px;">'via Blog this'</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3914734843767545698.post-64137604092425286122012-07-06T01:31:00.001-07:002012-07-06T01:31:59.732-07:00Microsoft Dynamics AX: Dynamics AX 2009 Bulk Data insert using SSIS - Arijit Basu | Dynamics AX MVP<a href="http://daxguy.blogspot.com.au/2010/03/dynamics-ax-2009-bulk-data-insert-using.html">Microsoft Dynamics AX: Dynamics AX 2009 Bulk Data insert using SSIS - Arijit Basu | Dynamics AX MVP</a>: <br />
<br />
<a href="https://chrome.google.com/webstore/detail/pengoopmcjnbflcjbmoeodbmoflcgjlk" style="font-size: 13px;">'via Blog this'</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3914734843767545698.post-6932841267650986802012-07-06T01:27:00.001-07:002012-07-06T01:27:03.025-07:00Dynamics AX 2009 - X++ Thread Development - Brandon George's Microsoft Dynamics AX Blog - AX Technical Blogs - Microsoft Dynamics Community<a href="http://community.dynamics.com/product/ax/axtechnical/b/brandongeorge/archive/2010/03/11/dynamics-ax-2009-x-43-43-thread-development.aspx">Dynamics AX 2009 - X++ Thread Development - Brandon George's Microsoft Dynamics AX Blog - AX Technical Blogs - Microsoft Dynamics Community</a>: "Dynamics AX 2009 - X++ Thread Development"<br />
<br />
<a href="https://chrome.google.com/webstore/detail/pengoopmcjnbflcjbmoeodbmoflcgjlk" style="font-size: 13px;">'via Blog this'</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3914734843767545698.post-79829915834415401782012-07-01T18:48:00.001-07:002012-07-01T18:48:22.910-07:00AX WONDERS: Intelligent Data Management Framework (IDMF)<a href="http://axwonders.blogspot.com.au/2011/12/intelligent-data-management-framework.html">AX WONDERS: Intelligent Data Management Framework (IDMF)</a>: "Intelligent Data Management Framework (IDMF)"<br />
<br />
<a href="https://chrome.google.com/webstore/detail/pengoopmcjnbflcjbmoeodbmoflcgjlk" style="font-size: 13px;">'via Blog this'</a>Unknownnoreply@blogger.com0