Skip to main content

Posts

Showing posts from 2012

differences between Enterprise User and Functional User or Task User

Differences between Enterprise User and Functional User/Task User.... Lets say,  1 Functional User; irrelative of the Role Assigned to it, what basic or advanced global functionality/Option/Screen of AX2012 he will not be able to see or access when compared with Enterprise User. Lets say for a client, I have a user "Machine Supervisor" whose role is not listed in 82 predefined roles in AX2012. My machine supervisor will be needing access to Production Cycle as well as access to Service Management Setups forms to perform his job.Now upon what criteria I will be deciding whether I need to purchase Enterprise/Functional/Task User?? there must be some boundaries (related to accessibility of forms/setup) associated with each CAL which gonna restrict me or bound me to choose between these CAL!! you need to access CALMappingtool to find what two or three roles gets consolidated in your custom role "Machine Supervisor". If default roles get covered through task or any

Error while installing Reporting extension for MS dynamics axapta

If you are facing following Error while installing Reporting extension for dynamics axapta. 1. Locate the AX Reporting services dll from the extracted AX 2009 SP1 folder [\\AX2009SP1\support\axsetupresources\microsoft.dynamics.setup.reportingservices.dll;File Version - 5.0.1000.52] 2. Copy the microsoft.dynamics.setup.reportingservices.dll i nto the folder: \\DynamicsAX\Msi\Components32\Program Files\Microsoft Dynamics AX\50\Setup [since my system is 32-bit so Components32] 3. It will ask to replace the existing dll having File Version - 5.0.593.0. Say Yes and replace. Now, carry on with the installation process. The issue coming from SQL server reporting component; not from AX if you are using sql 2005 then install service pack 2 for reporting extension or else if you wish to go for sql 2008 r2 then install full component of sql 2008 r2 after removing sql 2005 completely. in that case you need to reinstall your AX base components AOS, DB from scratch again. also you should

Password encrypt decrypt in MSD axapta 2012

To Store password or other secure information which cannot be read by any user in AX 2012. You can get code for password encryption and decryption.

Error Voucher do not balance as per date in MSD axapta 2009

Error AX-2009  The transactions on voucher 00_00004 do not balance as per 7/31/2012. (Company currency: 74,771.80 - secondary currency: 0.00) Suggestion : Make sure that you have entered Debit, and Credit side amounts. You need to mentioned the exchange rate in every entry where ever required, is there any need to mention the exchange rate in the exchange rate form. You have to enter the Exchange Rate in the Exchange rate form you do not have to enter it on the Voucher line since it is automatically populated, if you need to specify a certain rate you have option to update it on the voucher line. You need to check decimal rounding for Base and Secondary currency

Workflow error for users on second installation of MSD axapta instance

If you have installed second instance of AX 2012. Following are the problems. 1- The specified client configuration does not contain valid WCF settings. 2- As an administrator, Workflow is working fine for editing or else. But for the other users it show error. ": The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state." Suggestions looks like WCF setting issue... Create a new client config and create a new wcf connection from client configuration. also make sure full CIL is generated successfully since service classes are used in 2012 workflow. 1) make sure the server name is used not the ip and server name is reachable (pingable) from client for 2) Make sure u installed .Net Framework and all its updates / hot fixes are installed.. sometimes .net Fx 4 and client profile 4 has issue

TTSBEGIN TTSCOMMIT Error in MSD axapta

You may found an error while posting inventory journal (Inventory Counting, Inventory Transfer etc.) if you enable ModifiedDateTime property on InventJournalTrans or Inventory journal related tables. It throws following error. The operation cannot be completed, since the record was not selected for update. Remember TTSBEGIN/TTSCOMMIT as well as the FORUPDATE clause.  It should not throw error if it's only standard code and no customization is there. But the reason of this type of error is that somewhere update on record has been performed without selecting for forupdate clause or without locking the table. best way to know put a break point in info class and debug. There no single change in codes.you set the InventjournalTrans table ( I am not sure it was InventJournalTrans or inventTransPosting ) property ModifiedDateTime as YES and from one blog you can got the clue that It may happening because of this property. After removing this property it may work fine. apparently i

Closing stock of items datewise in MSD axapta

Sometimes we need to to find the Stock of Item by Date. You can set following code in for or while loop to get closing stock for all items in tables. You can get posted,recieved and deducted qty. screeshot of code is as above.

Tables which included in purchase order posting in MSD axapta

These are Tables which included in purchase order posting in axapta. These are main table of purchase order posting. InventTrans is common table for all type of inventory related transactions. PurchTable PurchLine PurchParmTable PurchParmLine InventTrans VendInvoiceJour VendInvoiceTrans VendInvoicePurchLink VendTrans VendTransOpen LedgerTrans TaxTrans TaxTrans_In

Clear User AUC cache file for all users in MSD axapta by code

Some times user face problem with axapta client instance startup then you need to clear cache file of user profile. .Auc file is right things to clear. You can delete it manually or by code for all users following way. #AiF SysSQMSettings _sysSQMSettings; ; ttsbegin; update_recordset _sysSQMSettings setting GlobalGUID = str2Guid(#EmptyGuidString); ttscommit; You need to restart AOS after running above code through job.

Create copy of movement journal entry by code in MSD axapta

To Create copy of movement journal entry by code in axapta you can try following code hint and can apply in loop also to create large number of entries. InventJournalCopy _InventJournalCopy = InventJournalCopy::construct(); _InventJournalCopy.getLast(); _InventJournalCopy.parmJournalIdFrom('JournaNum'); _InventJournalCopy.run();

Unable to logon MSDAX while client opening SSRS Report

Problem In AX 2012 , Error : "Unable to logon Microsoft dynamics ax" while clients opening SSRS reports. Solution Hints: your reporting server config needs to be checked properly. choose the default report server DB from configuration and check the logon criteria there. also you need to check correct report server config from AX admin module. Validate the settings on reporting services configuration manager. check the domain user has proper user groups in active directory also in AX system user roles should be assigned

suggestions to maintain two database on same application in MSD axapta

If there is  an interesting requirement where our client have offices that are located in different locations. The Internet connection is not that stable between the head office and all this offices and they want 100% availability of the system.  At the same time they want to work the whole system together so that one person on location1 will do something and head office guy will get the data instantly and work on it. Now to solve the high availability problem, one solution could be having separate AX system running in different offices. But the question comes how then the synchronization will happen with the head office? Is this possible to use multiple Ax systems in hub and spoke manner. Actually it depends on full scenario In one case where there is HQ and multiple site business all site businesses itself qualified as separate ERPs so individual ERPs are running on Site and consolidation data and all the bulk transactions get uploaded in the system. If you want details in th

Data Migration Framework Beta in MSD Axapta

Problem If Problem occured during setup of  the Data Migration Framework (BETA). If you have installed as per the description of Data Migration Framework Service , AOS, Client Component in documents. You have restarted the AOS and experiencing following problems. 1- when You open my AX client environment, it shows nothing and on click of new workspace. Then it will show you the whole AX control panel. 2- How to perform export/import MS Dynamics AX Power shell Execute the DMF package one after another in following sequence as per the description. 1- AOS 2- CLIENT 3- SERVICE Perform the import of server and client ax model through MS Dynamics SHELL. You have Increase the buffer size to 48. Re-started the AOS Service. but if you Open AX environment then no work until and unless you have to click new work space even as per the documentation regrading DMF, system will ask for the configuration and synchronization, but it didn't do that. Solution: Afer you import DM

Handling different printing behavior of different printers in MSD axapta

If you report is printing perfectly on one printer but not printing same format in another printer then you can follow follwoing steps to tackle that issues. Lets laserjet printer is working perfectly for report but EPSON printer is not working properly then read comments below to resolve that issues. 1) define a custom paper size using Printer Server Properties for that follow step a and b as under a) measure your paper size, and try to find approximate matching sized paper from http://en.wikipedia.org/wiki/Paper_size b) if you can find a paper size from above site which is near to your measured paper size, create a custom paper size in printer server properties on your printer If you are unable to find a approximately matching paper size among available sizes, just measure your paper in cm or inches and create the custom paper size in printer server properties 2) go start from one corner left upper of report and adjust each object on the paper. here object mean any text bo

Format Excel Worksheet of workbook in MSD axapta

This is code hints to Format Excel Worksheet of workbook in axapta. You excel workbook will be in xls or in higher version. You can open excel sheet by using visible true property then you can use other properties like font,style etc     #Excel SysExcelApplication excelApp; SysExcelWorkbooks XLSWorkbooks; SysExcelWorkbook XLSWorkbook; SysExcelWorksheet sheet; SysExcelRange range; SysExcelStyles styles; SysExcelStyle style; SysExcelInterior interior; SysExcelFont font; COM _char, RangeComObj; ; excelApp = SysExcelApplication::construct(); excelApp.visible(true); XLSWorkbooks = excelApp.workbooks(); XLSWorkbook = XLSWorkbooks.add(); sheet = excelApp.activeSheet(); range = sheet.range('A1'); styles = XLSWorkbook.styles(); style = styles.add('MyStyle'); interior = style

Post Journal in MSD axapta using x++ code

To post Journal in Microsoft dynamics axapta you can try following code. InventJournalTable _inventJournalTable; InventJournalCheckPost Class_journalCheckPost; ; ttsbegin; _inventJournalTable = InventJournalTable::find("JV0000124",true); _inventJournalTable.SystemBlocked = true; _inventJournalTable.update(); Class_journalCheckPost = InventJournalCheckPost::newJournalCheckPost (JournalCheckPostType::Post,_inventJournalTable); Class_journalCheckPost.run(); _inventJournalTable.SystemBlocked = false; _inventJournalTable.update(); ttscommit; In above code JournalCheckpost is standard axapta class which used to post journal. Your journal should be unblocked to post successfully.

Code to Post Sales Order in MSDAX

If you are trying to post Sales order in Microsoft Dynamics axapta by code then you can use this code in job. SalesFormLetter SalesformLetterObject; SalesformLetterObject = SalesFormLetter::construct(DocumentStatus::Invoice); SalesformLetterObject.update(SalesTable::find("SONO10003")); Here SalesformLetterObject is object of SalesFormLetter class and its initialized by using construct method and Document status as Invoice passed. Same way you can use for packing slip and picking of Sales order. After post you need to call update  to post Sales order transaction.

How to get first day date of month in MSD axapta

If you want to get first date of month then this is first simple or forceful method to get it. You can try following code in job. TransDate AnyDate=systemDateget(); TransDate FirstdateOfMth; ; FirstdateOfMth=mkdate(1,mthofyr(AnyDate),year(AnyDate)); info(date2str(FirstdateOfMth,123,2,2,2,2,4)); //This is second method to get first day of month. DateStartMth is standard global method to get first //date of month. TransDate AnyDate=today(); TransDate FirstdateOfMth; ; FirstdateOfMth=DateStartMth(AnyDate); info(date2str(FirstdateOfMth,123,2,2,2,2,4)); Systemdateget and today method will give you current system date.

Show all tables name and Total number of record of AOT in MSD axapta

To Show all tables name and Total number of record of AOT in axapta you can write following code in job . When you run the job you will get all tables with record count in info log. #AOT Name TableName; NumberOf TotalRecord; TrNode TrNode; SysDictTable SysDictTab; ; TrNode = TrNode::findNode(#TablesPath); TrNode = TrNode.AOTfirstChild(); while (TrNode) { TableName = TrNode.AOTname(); SysDictTab = SysDictTable::newTableId(TrNode.applObjectId()); TotalRecord = SysDictTab.recordCount(false); if (TotalRecord) info (strfmt("Table Name - Record count", TableName, TotalRecord)); TrNode = TrNode.AOTnextSibling(); }

Tables Used in Journal Posting in MSD axapta

In Axapta LedgerJournalTable is main table to store header information of of Journal and ledgerJournalTrans table used to store line level data. After posting of journal data entered in following tables. LedgerTrans If Tax information exists then its stored in taxtrans table if Vendor accounts used in ledger account field then information will be store in vendtrans also. Same way customer related information will store in custTrans table and bankaccounttrans table used to stored bank account details. If there is license for India then tax related information will also stored in taxTrans_In table.

Microsoft dynamics axapta companies Web Info in India

This is list of Microsoft dynamics axapta companies and website. You can add in comments if any other has been left by me. Godrej Infotech www.godrejinfotech.com TCS www.tcs.com NDS InfoTech www.ndsusallc.com Tectura www.tectura.com Blue Star InfoTech www.bsil.com Onward Technologies www.onwardgroup.com Capemini www.capgemini.com L&T InfoTech w www.lntinfotech.com Wipro InfoTech www.wipro.com Corporate Serve www.corporateserve.com Logica Worldwide www.logica.com Persistent Systems Limited www.persistentsys.com Dev Information technology Pvt. Ltd, Ahmedabad www.Devitpl.com columbus IT www.columbusglobal.com

How to define budget rate type in MSD axapta 2012

To define budget rate type in axapta 2012 you can read following tips. Problem:A budget rate type is not defined for the ledger.How to  Select a budget rate type for the ledger before you record budget register entries? Solution:  Go to General Ledger > Setup > ledger parameter and choose the budget rate type. Budget rate is the exchange rate you used to define what rate you will use in your budget go for ledger parameters and assign the same one available for you . The reason for this is required is companies sometime have a different policy for budget exchange rate so AX will allow you to track this rate as well as the original transaction rate.

Why Importing data through Template is dangerous in MSD axapta

Mostly ERP Does not allow to change posted records in the system but by importing data through template posted data can be change that is the main reason Importing data through template does comes under best practices. Lot of effects goes to tables during manual entry in the system but if you use templates then that effect may loss or you need to do extra coding on import criteria to maintain effects. There may be data redundancy through templates. So better way if user do manual entries in the ERP System that is more secure to save data for long time and its also good to get occuracy in the report.

code to send email from ax with attachment in MSDAX

This is the code to send email from axapta with attachment.You can write this code in method of any class and simple call it. InteropPermission IntCPermission = new InteropPermission(InteropKind::ComInterop); InteropPermission IntCPermission1 = new InteropPermission(InteropKind::ClrInterop); InteropPermission IntCPermission2 = new InteropPermission(InteropKind::DllInterop); str body,mailto, mailfrom; System.Net.Mail.AttachmentCollection attachementCollection; str FileName; FileIOPermission FilePerm; SysMailer mailer; SysEmailParameters parameters = SysEmailParameters::find(); ; try { IntCPermission.assert(); mailer = new SysMailer(); if (parameters.SMTPRelayServerName) { mailer.SMTPRelayServer(parameters.SMTPRelayServerName, parameters.SMTPPortNumber, parameters.SMTPUserName, SysEmailParameters::password(), parameters.NTLM); } else { mailer.SMTPRelayServer(parameters.SMTPServerIPAddress,

The process of cancel workflow in MSD axapta

compelling point before you install Microsoft Dynamics Axapta EP

here compelling point before you install Microsoft Dynamics AX EP: 1: Pre requisite 2:Configuration 3:Deployment(from the AOT to the web server/SharePoint server) 4:Site Creation  (1) Pre requisite: #1 WSS(Windows SharePoint Services) 3.0 or MOSS(Microsoft Office SharePoint services) 2007 SP1  IIS 6/7  .Net 3.5/ SP1  ASP.net 3.5 #2  SQLAMQ(SQL Analysis Object Management)           To connect to the back end services         #3  ADOMD.NET      .net BC must be installed  Note: X++ classes must be complied with .NET BC and Checklist must be completed

Exception Chart in MSD axapta

This is Exception Chart in Microsoft dynamics Axapta. Exception handling should start with try block and exception can be cache able  in catch section. Read below instruction to get more details. Exceptions are errors that may occur during the execution of a program. Keep in mind the following facts about exceptions: When an error occurs, an exception is thrown. When a system error occurs, an exception is thrown by the operating system. You can write code to throw custom exceptions. Handling an exception means dealing with the exception in an appropriate manner. Exception handling should not be used for normal program flow control. Exceptions are handled by enclosing your code in a try block and then using catch statements to handle exceptions that might be thrown.

Close MSD Axapta client or Instance by code in job

Close Axapta client or Instance by code in job. Info is class you can declare object of info class. Info class include shutdown method if you pass true parameter than it will close instance of axapta. SysGlobalCache SysGlobalCache1 = appl.globalCache(); info info; ; SysGlobalCache1.set(classstr(info), identifierstr(Autologoff), true); info = new info(); info.shutDown(true); Or you can set value in shutdown in user option form . You can also write following line to close axapta. Infolog.shutdown(true); It will close axapta forcefully.

Use Index Hint with query in MSD axapta

To use Index Hint with query in axapta you can refer following example where abcIdx is Index name in TestTable. Index hint help to improve performance of query. TestTable Test_New; select Count(ProductionId) from Test_New index hint abcIdx group by Test_New.Id where Test_New.Id == '123' && Test_New.tId == 'was1' && Test_New.TransDate >= str2date("01-Jul-2012",123) && Test_New.TransDate <= str2date("16-Jul-2012",123) && ;

Send mail via populate the outlook client by code in MSD axapta

To Send mail via populate the outlook client by code in axapta #ObjOutlookCOMDEF #define.outlook("Outlook.Application") #define.mapi("MAPI") COM ObjOutlook; COM ObjOutlookNameSpace; COM ObjOutlookMailItem; COM ObjOutlookAttachment; COM ObjOutlookRecipient; ; ObjOutlook = new COM(#outlook); ObjOutlookNameSpace = ObjOutlook.getNamespace(#mapi); ObjOutlookNameSpace.logon(); ObjOutlookMailItem = ObjOutlook.CreateItem('Outlook.OlItemType.olMailItem'); ObjOutlookMailItem.To("sksinght@abc.com"); ObjOutlookMailItem.Subject("Testing"); ObjOutlookAttachment = ObjOutlookMailItem.Attachments(); ObjOutlookAttachment.Add(@"d:\xyz.pdf",1,1,"New"); ObjOutlookMailItem.save(); ObjOutlookMailItem.display(); info("Activity launched in Microsoft Outlook"); ObjOutlookNameSpace.logoff();

How to insert tableid using Insert recordset in MSD axapta

How to insert tableid using Insert_recordset. Its work on latest version of dynamics ax only. int tab2 = tableNum(Table2); insert_recordset TABLE(RefRecId, RefTableId) select recId, tab2 from Table2 Syntax.. insert_recordset NameOfTable(field1, field2,field3,field4,field5) select field1, field2,field3,field4,field5 from RecOfTable where Concolm<=299999; //In SQL you can execute this way to work faster. SELECT * INTO table2 FROM table1;

How to remove special characters from string in MSD axapta

To remove special characters from string in axapta you can try following code . static void formatedString(Args _args) { str StringVal = “ Hello \tSumit \n Dear”; str replace(str _sourceStr, str _what, str _with) { int found = 0; str target = _sourceStr; ; do { found = strscan(TargetStr, _what, found, strlen(TargetStr)); if (found != 0) { TargetStr = strdel(TargetStr, found, strlen(_what)); TargetStr = strins(TargetStr, _with, found); found += strlen(_with); } } while (found != 0); return TargetStr; } ; StringVal = replace(StringVal, ‘\n’, ”); StringVal = replace(StringVal, ‘\r’, ”); StringVal = replace(StringVal, ‘\t’, ”); StringVal = replace(StringVal, ‘ ‘, ”); info(StringVal); }

Add sort field on grid using form datasource in MSD axapta

To Add sort field on grid using form data source in axapta  you can do following code in form data source table on execute query method. public void executeQuery() {; InventTable_ds.query().dataSourceNo(1).sortClear(); InventTable_ds.query().dataSourceNo(1).addSortField(fieldNum(CustTable,CustGroup), sortOrder::Ascending); super(); } After adding code you can call in modified method of control or init method of form. public boolean modified() { boolean ret; ; ret = super(); InventTable_ds.executeQuery(); return ret; }

ttsBegin and ttsCommit in MSD axapta

You can use ttsbegin and ttscommit with ttsabort following way. You can try in job public boolean myMethod() { try { ttsBegin; select forUpdate myTable; myTable.fname = testt_; myTable.update(); ttsCommit; } catch(exception::Error) { ttsabort; return(false); } return(true); }

Error on deploying the ssrs reports for reporting services in MSD axapta

If you are getting following Error on deploying  the ssrs reports for reporting services in axapta . could not load file or assembly 'microsoft.dynamics.kernel.cli ent. You can try following step to resolve this error. 1. copy the AXReports.exe file place to the folder: c:\Program files\Microsoft Dynamics AX\50\Client\Bin, and registering the Microsoft.Dynamics.Kernel.Client file in the GAC by dragging and dropping the file to the folder: c:\windows\assembly. 2. Checke for user permission issues. 3. Check whether  Reporting service SIte Link Working or not.

Sale order table structure in MSD axapta

If you want to know sales order table flow then you need to know following flow. for customer following table user Custparameter CustTable, CustGroup. Sales Order front screen table SalesTable->SalesParmtable SalesLine->Sale order table structure in axapta After posting data goes to CustInvoiceJour CustInvoiceTrans CustTrans Financial voucher effect goes to LedgerTrans. InventTrans Table is common table for all inventory.

Example of sending mail in MSD Ax

To send mail you can try code in following way in job . You can then set this code in your way in form or dialog . str sendereml = 'sendereml@domainname.com'; str recipienteml= 'recipient@domainname.com'; str cc1 = 'cc@domainname.com'; str subject = 'Testing'; str MailBody = 'Testing mail txt -hello how r u'; str fileName1 = @'C:\Testing1.txt'; Set permissionSet; System.Exception e; str mailServer; System.Net.Mail.SmtpClient mailClient; System.Net.Mail.MailMessage mailMessage; System.Net.Mail.MailAddress mailFrom; System.Net.Mail.MailAddress mailTo; System.Net.Mail.MailAddressCollection mailCCCollection; System.Net.Mail.AttachmentCollection mailAttachementCollection; System.Net.Mail.Attachment mailAttachment; ; try { permissionSet = new Set(Types::Class); permissionSet.add(new InteropPermission(InteropKind::ClrInterop)); permissionSet.add(new FileIOPermission(filename1, &#

How to get the address of customer in a single line in Report in MSD axapta

To get the address field of customer in a single line in Report or form in axapta you can get hints by following code. DirPartyId partyId; DirPartyAddressRelationship dirPartyAddressRelationship; DirPartyAddressRelationshipMapping dirPartyAddressRelationshipMapping; Address address; str resultAddress; ; partyId = DirPartyTable::find(CustTable::find('1101').PartyId).PartyId; select dirPartyAddressRelationship where dirPartyAddressRelationship.PartyId == partyId; select dirPartyAddressRelationshipMapping where dirPartyAddressRelationshipMapping.PartyAddressRelationshipRecId == dirPartyAddressRelationship.RecId; select address where address.dataAreaId == dirPartyAddressRelationshipMapping.RefCompanyId && address.RecId == dirPartyAddressRelationshipMapping.AddressRecId; resultAddress = address.Street+" "+address.City+", "+address.State+" "+address.ZipCode+" "+address.CountryRegionId;

Send message from one computer to other by MS Dynamics axapta code

To Send message from one computer to other by Dynamics axapta code you can try following code in ax job. COM netSendComObj; InteropPermission InteropPermission1 = new InteropPermission(InteropKind::ComInterop); int Result; str NameOfMachine = Winapi::getComputerName(); str MSG = ‘Hello how are you.Do you know me I am Dynamics AX’; InteropPermission1.assert(); try { netSendComObj = new COM("WScript.Shell"); Result = netSendComObj.Run(strFmt("net send %1 %2", NameOfMachine, MSG),0,true); } catch (Exception::Error) { CodeAccessPermission::revertAssert(); throw Exception::Error; } if (Result != 0) { warning(strfmt(‘Sending message Failed’, NameOfMachine)); warning(‘Check messenger service is Started’); } CodeAccessPermission::revertAssert();    

Message in event log using Microsoft dynamics axapta code

To  Write message in event log by dynamics axapta code x++ you can try following code in job of AOT. System.Diagnostics.EventLog EventLogObj = new System.Diagnostics.EventLog(); ; EventLogObj.set_Source(‘Dynamics Axapta -Message from Admin’); EventLogObj.WriteEntry("This is just checking of message in event log form Dynamics ax"); EventLogObj.Close();

Start and stop windows services in MSD axapta by code

To Start and stop service in axapta by code You first add  reference System.Service Process in Application Object tree (AOT) on reference node after doing this you can add following code in job. System.ServiceProcess.ServiceController ServiceController1 = new System.ServiceProcess.ServiceController(); ; ServiceController1.set_MachineName(‘.’); ServiceController1.set_ServiceName("IISADMIN"); ServiceController1.Stop(); sleep(500); ServiceController1.Start();

How to show value in dialog on the basis of other field in MSD axapta

To show value in dialog on the basis of other field in axapta , you can try  code in report following way. public class Test extends ObjectRun { DialogField dlgfld1,dlgfld2; InventLocationId _InventLocationId; Name _name; } public Object dialog(Object _dialog) { DialogRunbase dialog = _dialog; ; dialog.caption('Location Details'); dialog.addGroup('Select Location Id :'); dlgfld1 = dialog.addField(typeid(_InventLocationId),"Location Id : "); dlgfld1.value(_InventLocationId;); dlgfld2 = dialog.addField(typeid(_Name),"Location name : "); dialog.allowUpdateOnSelectCtrl(true); return dialog; } public void dialogSelectCtrl() { ; dlgfld2.value(InventLocation::find(dlgfld1.value()).Name); } boolean getFromDialog() { ; _InventLocationId; = dlgfld1.value(); _name = dlgfld2.value(); return true;. }

How to Assign one user rights to other user by code in MSD axapta

You can try following code in Job or you can apply in form controls event. UserGroupList UsergroupList1,UsergroupList2; UserId FromUserId, ToUserId; ; FromUserId = 'usr1'; ToUserId = 'usr2' ; delete_from UsergroupList1 where UsergroupList1.UserId == ToUserId; while select UsergroupList1 where UsergroupList1.userId == FromUserId { info(strfmt('Group assigned: %1',UsergroupList1.groupId)); select forupdate UsergroupList2 where UsergroupList2.userID == ToUserId && UsergroupList2.GroupId == UsergroupList1.GroupId; if(!UsergroupList2) { UsergroupList2.UserId = ToUserId; UsergroupList2.GroupId = UsergroupList1.GroupId; UsergroupList2.insert(); } } info(strfmt('Permissions changed for %1',ToUserId));

How to get Location of folder of MS dynamics axapta and windows folder

xInfo::directory(DirectoryType::Bin); xInfo::directory(DirectoryType::Temp) xInfo::directory(DirectoryType::Include); xInfo::AOTLogDirectory(); xInfo::directory(DirectoryType::Help); xInfo::directory(DirectoryType::APPL); For windows you can try these command WinApi::getTempPath() WinAPI::getFolderPath(#CSIDL_INTERNET_CACHE); WinAPI::getFolderPath(CSIDL_DESKTOPDIRECTORY);

Get current date in differert way by MSD axapta

How to Get current date in differert way by axapta info(date2str(today(),123,2,2,2,2,4)); //This method will show you date of the machine. There is no support of time. info(date2str(systemdateget(),123,2,2,2,2,4)); //This method will show you current system session date.You can change session date under tool //session menu. //Following are mehtod for to show date with time . Juse use and see it. info(date2str(DateTimeUtil::date(DateTimeUtil::getSystemDateTime()),123,2,2,2,2,4)); info(date2str(DateTimeUtil::date(applyTimeZoneOffset(DateTimeUtil::getSystemDateTime(), DateTimeUtil::getUserPreferredTimeZone())),123,2,2,2,2,4));

How to import xpo in MSD axapta by code

How to import xpo in axapta by code. You can write following code in job or any where you want to import like form,class,report etc. SysImportElements ElementToImport = new SysImportElements(); ; ElementToImport.newFile("D:\\TestProject.xpo"); // XPO filename which may be project,form,report or any thing from aot ElementToImport.parmImportAot(true); ElementToImport.parmImportWithIds(false); ElementToImport.import(); You write this code in method or can directly write in overridden method clicked  on button control.

Microsoft Dynamics Axapta client instance opening problem

If you are facing client opening problem then you can try this to resolve the issue. You can delete *.auc file then retry to  open axapta instance this file will recreate automatically in same folder . c:\Documents and Settings\\local settings\application data\*.auc You can go for same folder for particular user. I hope your problem get resolved.

Table creation in AOT By code in MSD Axapta

 Code To Create a New Table in axapta. Write following code in job and check table in aot after execution of job. TreeNode treenode; AOTTableFieldList fieldlist; #AOT ; treenode = TreeNode::findNode(#PathOfTable); //PathOfTable =\\Data Dictionary\\Tables\\TestTable\\Fields' treeNode.AoTadd("NameofTable"); sqlDataDictionary::Synchronize(); treeNode.AoTFindChild(NameofTable); filedlist = treenode::AOTfieldchild(NameofTable).AOTfindchild('Fileds'); fieldList.addString('Name'); fieldList.addInteger('Address'); fieldList.addReal('City'); Info(" Table Created"); By above code new table testTable will be created with Name,Address and city field. You can use this code in your form customization also.

Points to follow on Item Id rename process in MSD axapta

Points to follow on Item Id rename process in axapta. If you are renaming item id in axapta then you need to keep following points in mind otherwise your system will get hangs. 1. Whenever the item id is to be renamed, that particular item id should be "stop" in the system and then the renaming process can be done. 2. Ideally item id should not be renamed and if only need be such process should be done . 3.This process of item id rename should be done in single user mode so that no other transaction is done in the system when this process is been done.  Please take note of my suggestion.

Create Graph and load data to graph using MSD axapta

void createGraph1() { //SalesLine salesline; LedgerBudget ledgerBudget; int i,k; str month; // date createddate; #macrolib.ChartFx ; graphics1 = Graphics::newGraphicsTitlesLayout(ChartX1, 100, 200,'Title', 'X', 'Y', 'z',1 ,1, 1, 1); graphics1.create(); graphics1.parmTitle("MonthWise Comparison(G)"); graphics1.parmTitleXAxis('Month'); graphics1.parmTitleYAxis('Amount'); ChartX1.Chart3D(true); ChartX1.toolBar(true); //graphics.Gallery(9); graphics1.parmHeight(350); graphics1.parmWidth(450); AllocApr=0; AllocMay=0; AllocJun=0; AllocJul=0; AllocAug=0; AllocSept=0; AllocOct=0; AllocNov=0; AllocDec=0; AllocJan=0; AllocFeb=0; AllocMar=0; while select * from LedgerBudget where LedgerBudget.Key!="" //ledgerBudget.AccountNum==ledgerTable.AccountNum { // DivisionName=divnm; // if (salesline.createdDate >= fromDate &&

Set an Application Object Server and client instance to enable printing in MSD Axapta

Set an Application Object Server instance to enable printing 1. Open the Server Configuration utility on following path Start > Administrative Tools > Microsoft Dynamics AX Server Configuration. 2. On the Application Object Server tab, click Connect to printers on this server, and then click OK. Once this option enable then ax service will restart automatically then printing option from server will be enable. I hope this will work for you. Same thing you can do for axapta client configuration to enable printing form axapta client but there this option is available on connection tab.

Set an startup message for Microsoft Dynamics AX client on opening

Set a startup message for Microsoft Dynamics AX client To set a startup message 1. Open the Configuration Utility on path Start > Control Panel > Administrative Tools > Microsoft Dynamics AX Configuration).  2. On the General tab, in the Startup message box, enter the message you want to display like "This is Live" or "This is Test Application" etc, and then click OK. Other References

Assign single login per user in MSD axapta

Thia code is Assign single login per user in axapta  I hope this will help you lot select count(recid) from clientSessions where clientSessions.userId==curuserid() && clientSessions.Status!=0 && clientSessions.sessionType==0; if(clientSessions.RecId>1) { for (i=1; i<=50; i++) { progress.incCount(); progress.setCaption('Login Error'); progress.setText(strfmt("User '%1' Already Taken login session ",curuserid())); sleep(10); } infolog.shutDown(true); }

Creating class in Microsoft Dynamics ax 2009

declare following variables in class DialogField DialogFromDate,DialogToDate; // DateTimeUtil fromDate; // DateTimeUtil toDate; FromDate fromDate; ToDate toDate; protected Object dialog() { Object ret; DialogRunbase dialog; //= super(); Dialog = super(dialog); Dialog.caption("Percentage Calculation"); DialogFromDate = dialog.addField(typeid(FromDate)); DialogToDate = dialog.addField(typeid(ToDate)); return dialog; } public boolean getFromDialog() { boolean ret; ret = super(); fromDate=dialogFromDate.value(); toDate=dialogToDate.value(); return ret; }

Flags control example in report of MSD Axapta

Flags control example in report of Axapta I think its going to difficult to understand. public boolean fetch() { // boolean ret; // ret = super(); boolean HeaderFlag; boolean ProgFlag; boolean FirstRun; Boolean HeaderOnFirstRun; QueryBuildDataSource qbds__RegBatchProcess; QueryBuildRange QrRegNo,qrcrop,rangeTransDate,QBR_TechYear; Query q = new Query(); ; q = this.query(); qbds__RegBatchProcess = q.dataSourceTable(tablenum(_RegBatchProcess)); //Add Sort Field qbds__RegBatchProcess.addSortField(fieldnum(_RegBatchProcess, InventLocationId));//1 Center qbds__RegBatchProcess.addSortField(fieldnum(_RegBatchProcess, _seasonid));//2 Season qbds__RegBatchProcess.addSortField(fieldnum(_RegBatchProcess,Stg));//3 Stage qbds__RegBatchProcess.addSortField(fieldnum(_RegBatchProcess, ItemId));//4 Crop qbds__RegBatchProcess.addSortField(fieldnum(_RegBatchProcess, CustAccount));//5 MPCode qbds__RegBatchProcess.addSortField(fieldnum(_RegBa

Show field of run time control in MSD axapta

public void showFields(tableId tableId,FormGridControl formGridControl1, FormBuildDataSource formDataSource1) { FormStringControl formStringControl1,formStringControl2; DictTable dictTable; DictTable dictTable1; DictTable dictTable2; fieldId fieldId; int i; int t; int fieldCnt; Query Q1; str ColValue[]; str strQuery; object formRunCaller; ; formRunCaller = element.args().caller(); testId1=formRunCaller.MethodA(); dictTable1 = new DictTable(_TestColumn.TableId); // dictTable2 = new DictTable(_TestRows.TableId); dictTable = new DictTable(tableId); select * from _TestColumn where _TestColumn.QId == _Question.QId && _TestColumn.TestId==testId1 ; if(_TestColumn) { ColValue[1] = _TestColumn.Col1; ColValue[2] = _TestColumn.Col2; ColValue[3] = _TestColumn.Col3; ColValue[4] = _TestColumn.Col4; ColValue[5] = _TestColumn.Col5; ColValue[6] = _TestColumn.Col6; ColValue[7] = _TestColumn.Col7; ColValu

Save value to table from run time control in MSD Axapta

Save value to table from run time control in Axapta void SaveAll() { int i; int a; int c; boolean flg=true,flg1=true; FormStringControl FormStr1; FormStringControl formStringControl1; FormGroupControl formGroupControl1; str oldqid,tid,oldtxt; FormTabControl formTabControl1; FormTabPageControl formTabPageControl1; FormBuildTabControl formBuildTabControl; FormBuildGroupControl formBuildGroupControl; FormBuildTabPageControl formBuildTabPageControl; FormBuildStringControl formBuildStringControl; _TestResult _testResult1; str s,fcname; formControl fc,fc1; boolean f=false; FormStringControl control = element.controlCallingMethod(); Integer yy,x; int cnt=0,cnt1=0; str id,AnsTxtGrid; int t; int rcnt,tmpcnt,rowid1; str 10 AnsTxt; str lable; DictTable dictTable; TableId tableID; object formRunCaller; TestId testId2; ; idrow=1; rowid1=1; //tmpcnt=16; formRunCaller = element.args().calle

code to Modify Multiple selected rows in grid of axapta

code to Modify Multiple selected rows in grid of axapta TestTable _TestTable, _TestTableAux; ; for(_TestTable = TestTable_DS.getFirst(); _TestTable; _TestTable = TestTable_DS.getnext()) { ttsbegin; select firstonly forupdate _TestTableAux where _TestTableAux.recId = _TestTable.recId; if(_TestTableAux) { TestTableAux.ID = "New Id"; TestTableAux.update(); } ttscommit; }

Execute excel macro from Microsoft dynamics axapta application

Execute excel macro from dynamics axapta application //variable declaration SysExcelApplication xlsAppObj; SysExcelWorkbooks xlsWorkbooks; SysExcelWorkbook WorkBook; SysExcelWorksheet Worksheet; str fileName; ; xlsAppObj = SysExcelApplication::construct(); xlsAppObj.displayAlerts(true); xlsAppObj.visible(true); xlsAppObj.workbooks().open("SomeExcelFile.xls"); xlsWorkbook = xlsAppObj.workbooks().item(1); Worksheet = xlsWorkbook.worksheets().itemFromName("NameOfWorksheet"); //execute excel macro xlsAppObj.comObject().Run("XlsMacroName"); //Other excel related code is here //Filename fileName = "C:\\abc.xlsx"; //Check whether the document already exists if(WinApi::fileExists(fileName)) WinApi::deleteFile(fileName); //Save Excel document xlsWorkbook.saveAs(fileName); //Open Excel document xlsApplication.visible(true); //Close Excel

Domain name user has not enough rights error in enterprise portal in MSDAX

Domain name user has not enought rights error in enterprise portal After installation of enterprise portal then if error come at the time of running ep site for particular user and it says domain name/user has not enought rights error. It may work for administrator but for other user you need to do following. Add domain account to local administrators group to do this follow following steps Rightclick on Computer and then go to manage local users and  groups -> groups , Right click on Administrator go to properties and go to Add user.

error code 10509 Check error. The check digit read in the data is in MSD axapta

You will run into this problem with entire table cached table is used in highly transactional scenarios. Entire Table Cache should be used only for static data which are updated rarely. An example would be a list of states. The entire table cache operates by offloading the entire table's data onto AOS to provide faster look ups. Whenever the data changes, the entire cache is flushed and the next read operation offloads the entire table again. This is performance intensive and not recommended for transactional tables. When this error happens, it means that some other process update the data in the entire table cache while it was being used by your process. To fix this problem, 1. If it is a high transaction table, do not use entire table cache. Use Found ; Empty instead. 2. If this is not a high transaction table but gets significant insert/update/delete during one specific process, disable cache in that process by setting .disableCache(true)