Skip to main content

Posts

Showing posts from August, 2012

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.