Skip to main content

Posts

Showing posts from September, 2018

How to fetch Values from WorkFlow Tables

How to fetch Values from WorkFlow Tables Hi friends,    I am facing a problem since many days and now i got the logic to fetch values from a workflow table, but still it’s for only PO and PR and i am working on the GL transaction also, here is the Code, Use copy and paste it in a job and run. static void theaxapta_WorkflowHisory() {     WorkflowTrackingTable           workflowTrackingTable;     WorkflowStepTable               workflowstepTable;     WorkflowTrackingStatusTable     workflowTrackingStatusTable;     WorkflowTrackingCommentTable    workflowTrackingCommentTable;     utcdatetime     dt[];     string100     Comment;     int i;     ;     i = 1;    select workflowtrackingtable join workflowsteptable     where workflowsteptable.StepId ...

Add a button to go to Main Transaction

Hi guys, The following code for adding a button on your forms to go to the main transaction form/table, to do this type of magic you have to add a button on you form and copy paste the following code in the click method of that button. void clicked() {     Common buffer;     selectableDataArea company = curExt();     Args args = new Args();     SysDictTable dictTable;     FormRun formRun;     WorkflowTrackingStatusTable trackingStatus;     ;     trackingStatus = WorkflowTrackingStatusTable::findByCorrelation(WorkflowTrackingStatusTable.CorrelationId);     if (trackingStatus.RecId)     {         changecompany(trackingStatus.ContextCompanyId)         {             dictTable = new SysDictTable(trackingStatus.ContextTableId);             buffer = dictTable.makeRecord();       ...

Document Handling In Axapta

Document Handling In Axapta When we create a new word document through document handling , we can transfer data from tables in Microsoft Dynamics AX to bookmarks in the new document. This is done by creating a template with some standard text and some bookmarks where the data from tables are to be inserted. For example we can transfer the address and contact information for a customer to the letter head in a Microsoft Word document when creating a new letter for that customer. Prepare a Word template :We need to create a Word template with bookmarks where the data should be inserted. Then we set up the document type by linking the document type to the template and by adding the data fields to be transferred to the individual bookmarks. Step I : Create a Word template 1.            Open Microsoft Office Word. 2.            In the new template, add the text and graphics we want to appear in all new doc...

How to find All Usr Layer Element in AOT

How to Find all the elements which in present in USR layer To find all USR layer elements in AOT , you can write job with following code, when you will run this job it will create a new project named "TheAxapta_UsrObject". In this Project you find all elements which is present in USR layer by individual grouping. This a good way to find all USR element. static void FilterBasedOnLayers(Args _args) {      sysprojectfilterrunbase upgradeproject;     utilelements            theelements;     ;     upgradeproject = new sysprojectfilterrunbase();     upgradeproject.parmProjectNode(systreenode::createProject('theaxapta_UsrObject'));     upgradeproject.grouping(sysprojectgrouping::AOT);     while select name, utilLevel, RecordType, ParentId from theelements     where theelements.utilLevel == UtilEntryLevel::usr     {         try       ...

Merging two Table Records

Merging two Table Records Hi guys, some times we need to merge two records within one line of table, so to do this you can use following code, here for example i am using VendTabel and try to merge two vendors whose a/c no is 5001 and 5002 within 5001. //we will explore how to correct such a situation by merging two records including //all their related transactions. For the demonstration, we will merge two vendor accounts 5001 //and 5002 into a single one, that is, 5001. static void VendAccountMerge(Args _args) { VendTable vendTable; VendTable vendTableDelete; PurchJournalAutoSummary jourSummary; #define.vend('5001') #define.vendDelete('5002') ;      ttsbegin; delete_from jourSummary where jourSummary.VendAccount == #vendDelete; select firstonly forupdate vendTableDelete where vendTableDelete.AccountNum == #vendDelete; select firstonly forupdate vendTable where vendTable.AccountNum == #vend; vendTableDelete.merge(vendTable); vendTable.doUpdate(); vend...