随笔分类 - X++
摘要:一般在AX中有些编号是【装箱单号】是以0开头的字符串组成的编号,但是当我们导出且保存成csv或者xlsx格式的时候,打开文件时,系统加载字符串编号会自动默认为数字格式,会把编号最前面的O去除,且以数字的格式显示在界面上。导致数据显示异常。我们其实可以通过x++代码与Excel读取数据的原理解决这个问题。如tmpInventCardExpiry.PackingSlipId = PackingSlipId ? '="' + PackingSlipId + '"': "";
阅读全文
摘要:add the display method under the table methods nodes.public display WorkflowStatusUserName getApproverUserName(){ WorkflowTrackingStatusTable trackingStatusTable; WorkflowTrackingTable workflowTrackingTable; ; select firstOnly User from workflowTrackingTable ord...
阅读全文
摘要:When I worked for Microsoft I wrote a blog on how to send the X++ callstack in AX to the infolog. Here is that post: http://blogs.msdn.com/b/axsupport/archive/2010/08/02/how-to-send-the-callstack-to-the-infolog.aspxSending the callstack to the infolog is extremely helpful when troubleshooting an iss
阅读全文
摘要:Adding Find\Filter functionality on Display methodOverride Context method of Form control which is using display method and provide code for filter. E.g I have done below for PhysicalInvent field of InventOnHandItem form.void context(){ int selectedMenu; real test; formrun fr; Args ag; ...
阅读全文
摘要:In Dynamics AX 2009, it was pretty simple as you had to just loop through LedgerTrans table, AX 2012 it has changed a bit.Lets take an example and see how we can achieve this. Say you want to display following information in a report (for example purpose we will use infolog).Main account number – Ma
阅读全文
摘要:static client server NumberSequenceReference numRefVirtualNetworkId(){ return NumberSeqReference::findReference(typeId2ExtendedTypeId(typeid(HRMVirtualNetworkId)));} NumberSeq= NumberSeq::newGetNum(HRMVirtualNetworkParameters::numRefVirtualNetworkId(), true, true); if (!numberSeq) //checkFailed(&quo
阅读全文
摘要:Read CSV with CommaIO //Changedon17April2012at10:12:15byJimmyxiestaticvoidTHK_csvRead(Args_args){#AviFilesSysOperationProgressprogress=newSysOperationProgress(1,true);strfilename;FileNameFilterfilter=['Allfiles','*.CSV'];CommaIOcommaIO;containerInData;InventItemLocationitemLocation;I
阅读全文
摘要:CLRError//BPDeviationdocumentedstaticutcDatetimeTHK_UTCDatetime(name_datetimeStr){utcDatetimedt;InteropPermissionpermission;namedatetimeStr=strlrTrim(_datetimeStr);System.Exceptionex;strClrErrCatch;;try{//NecessaryifexecutedontheAOSpermission=newInteropPermission(InteropKind::ClrInterop);permission.
阅读全文
摘要:staticbooleanJimmy_validateEmail(str_email){stremailRegex=@"^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$";stremail;ListemailAddresses;ListEnumeratorenum;System.Text.RegularExpressions.RegexregEx;System.Text.RegularExpressions.Matchreg
阅读全文
摘要:staticclientvoidJimmy_ImageToModule(){TreeNodetreeNodeMenu;;treeNodeMenu=SysDictMenu::newMenuName(menustr(Jimmy)).parmTreeNode();if(treeNodeMenu){treeNodeMenu.AOTsetProperty(identifierstr(NormalImage),SysResource::getImagePath(resourcestr(Jimmy_jpg)));treeNodeMenu.AOTsave();}}
阅读全文
摘要://VARChangedon19Mar2012at13:02:40byJXie7519voidTHK_allowEditFieldList(FormDataSource_tableDS,boolean_allowEdit=false){intfield;DictTabledictTable;DictFielddictField;tableIdtableId=_tableDS.table();fieldIdfieldId,costCenter=fieldId2Ext(fieldnum(CustInvoiceTable,Dimension),2);;dictTable=newDictTable(.
阅读全文
摘要:To set the focus on specific control when form is open, you need to override the firstField() method of the form and set your desired control after super() call.publicvoidfirstField(int_flags=1){;super(_flags);desiredControlName.setFocus();}
阅读全文
摘要:The operation progress formThe form showing the progress has five important parts:1. Caption2. Animation3. Operation description4. Progress indicator5. Time remaining calculation Initialization Before you can begin, you must initialize the class SysOperationProgress: SysOperationProgress progess = n
阅读全文
摘要:THK_blockSalesLines method from salesTable table//VARChangedon11Oct2011at11:02:29byTHK7519staticvoidTHK_blockSalesLines(SalesId_salesId,boolean_block=true){#avifilesSalesLinesalesLine;SysOperationProgressprogress;inti;booleanupdated;;ttsbegin;selectcount(recId)fromsalesLinewheresalesLine.SalesId==_s
阅读全文
摘要:Reference X++ codeFileName FileName; FileNameFilter Filter = ["CSV file", "*.csv"]; #WinAPI; FileName = winapi::getSaveFileName(infolog.hWnd(), filter, WinAPI::getFolderPath(#CSIDL_Personal), "Save as CSV file","csv",element.design().caption()); if(!FileName)
阅读全文
摘要:01)using TextBuffer class handleTextBuffer//1,使用TextBuffer从Ax2009中导出数据到CSV文件中://http://www.qiuhao.com/forum-redirect-tid-13763-goto-lastpost.html#lastpoststaticvoidJimmy_ExportToCSVFile01(Args_args){TextBuffertextBuffer=newTextBuffer();InventTableinventTable;FileIoPermissionperm;counterLines;#define
阅读全文
摘要://Changedon08十一月2011at17:08:25byJimmyXiestaticUTCDateTimedateTimeNull(){UTCDateTimeutc;;utc=1900-01-01T00:00:00;//orutc=DateTimeUtil::parse("1900-01-01T00:00:00");//orutc=str2datetime("1900/1/100:00:00am",321);returnutc;}
阅读全文
摘要:Sometimes, We start out in the PurchTable form where we, by clicking a button, calls a class with the help of a menu item. The menu item has been given the datasource PurchTable.The called class updates the record that was selected in the PurchTable, but when this is done the user cannot see the cha
阅读全文
摘要:Sometimes, I want to find all the table field and modify or remove data with the EDT from AOT - > dictionary.staticvoidJimmy_FindEDTFromDictionary(Args_args){inti,counter;intnumberOfFields;DictionaryDictionary=newDictionary();DictFieldDictField;DictTableDictTable;//CommonCommon;fieldIdfieldId01,f
阅读全文
摘要:This X++ Code Snippet post describes how you can easily copy records by running over all of the fields of the from-record. During this looping over all the fields, you can exclude some fields if needed.Create following method in a class:Jimmy_GlobalstaticvoidJimmy_CopyoingField(Common_from,Common_to
阅读全文

浙公网安备 33010602011771号