Kategori: Uncategorized
-
Approve Workflow by Code x++
WorkflowWorkItemTable WorkflowWorkItemTable; while select WorkflowWorkItemTable where WorkflowWorkItemTable.UserId == ‘hasan.bi’ && workflowWorkItemTable.Type == WorkflowWorkItemType::WorkItem && workflowWorkItemTable.Status == WorkflowWorkItemStatus::Pending && WorkflowWorkItemTable.RefTableId == tableNum(CPMContractAdvanceRequest) { WorkflowWorkItemActionManager::dispatchWorkItemAction( …
-

CIL generation errors and solutions
thansks blog.. http://axvuongbao.blogspot.com.tr/2013/12/fix-parameter-could-not-be-serialized.html Fix some errors from: CIL generation, Database Synchronize in AX 2012 1.) “A parameter could not be serialized”:For a quick resolve: uncheck option “Excute business operations in CIL” under Tools-> Options -> Development tab. The reason is that you haven’t been able to do a successful FULL CIL compile.Run again and try to…
-
Document Attachment through X++
static void hb_attach(Args _args) { DocuRef docuRef; DocuActionArchive archive; CustTable _custtable; str _name; ; _name=@”c:\hb.docx”; select RecId from _custtable where _custtable.AccountNum ==”M0001″; if (_custtable!=null) { ttsBegin; docuRef.clear(); docuRef.RefRecId = _custtable.RecId; docuRef.RefTableId = tableNum(“custtable”); docuRef.RefCompanyId = curext(); docuRef.Name = _name; docuRef.TypeId = ‘File’; docuRef.insert(); archive = new DocuActionArchive(); archive.add(docuRef, _name); ttsCommit; } }
-
Get full physical path on attachment AX 2012
select firstOnly DocuReforder by docuRef.RecId DESC where DocuRef.RefRecId == 645484 && docuRef.RefTableId == 56446 && docuRef.RefCompanyId == curext(); filename = DocuRef.completeFilename();
-
Send event by x++
static void Event_sendAlertByCode(Args _args) { EventNotificationSource _source; EventNotification event = EventNotification::construct(EventNotificationSource::Sync); InventTable inventTable; ; inventTable = InventTable::find(‘03.09.2013’); // sample record for which alert is shown event.parmRecord(inventTable); event.parmUserId(curuserid()); // user for…
-
Send mail with outlook
Description255 recipientEmail; Notes emailBody; Description255 subjectText; Filename fileName; SmmOutlookEmail …
-
progressbar sample
static void operationProgress_progressBars(Args _args) { #AviFiles SysOperationProgress progress = new SysOperationProgress(); int i; ; progress.setCaption(“Progress bar example…”); progress.setAnimation(#AviUpdate); progress.setTotal(10000); progress.getCount_RU(); for (i = 1; i <= 10000; i++) { progress.setText(strfmt(“The value of i is %1”, i)); progress.setCount(i, 1); } }
-
Kill the excel
System.Collections.IEnumerable processes; System.Collections.IEnumerator enumerator; System.Diagnostics.Process process; try { processes = System.Diagnostics.Process::GetProcessesByName(“EXCEL”); enumerator = processes.GetEnumerator(); while (enumerator.MoveNext()) { process = enumerator.get_Current(); process.Kill(); } } catch (Exception::CLRError) { throw error(AifUtil::getClrErrorMessage()); } thanks for Martin. Martin!!! you are the man:) https://dynamicsuser.net/ax/f/developers/68865/axapta-close-windows-application-process-with-x