Skip to main content

Posts

Display Address from multiple to single line in MSD axapta

Display Address from multiple to single line in axapta Mostly we face issue to Display Address from multiple to single line in axapta report in Ax 2009 . Following is the way to do it very easily. Code snaps is as below.. str lineall; ; lineall =lineall +strline(CompanyInfo::find().Address,0); lineall =lineall +strline(CompanyInfo::find().Address,1); lineall =lineall +strline(CompanyInfo::find().Address,2); lineall =lineall +strline(CompanyInfo::find().Address,3); lineall =lineall +strline(CompanyInfo::find().Address,4); lineall =lineall +strline(CompanyInfo::find().Address,5); return lineall;

Validate Name in MSD Axapta

Validate Name in Axapta To Validate Name in Axapta  you can refer below code. --------------------------------------Code block---------------------------- boolean validatestrName(str strName) { Boolean valid,flag; System.Boolean flagTest; str matchstrNo = "^[a-z, ,A-Z]+$"; System.Text.RegularExpressions.Match myMatch; New InterOpPermission(InteropKind::ClrInterop).assert(); myMatch =System.Text.RegularExpressions.Regex::Match(strName,matchstrNo); flagTest = myMatch.get_Success(); flag = flagTest; CodeAccesspermission::revertAssert(); if(strName == "") return true; else return flag; } --------------------------------------End Code block-------------------------

SSRS Report deployment Error in MSD Axapta

SSRS Report deployment Error details;-  On SSRS  Report deployment getting below error form ssrs deployment log file. Deployment failed with the following exception: System.Runtime.InteropServices.COMException (0x80040208) at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) at System.Management.ManagementObject.Initialize(Boolean getObject) at System.Management.ManagementBaseObject.get_Properties() at System.Management.ManagementBaseObject.GetPropertyValue(String propertyName) at Microsoft.Dynamics.Framework.Deployment.Reports.SrsWmi.get_ConfigPath() at Microsoft.Dynamics.Framework.Deployment.Reports.ReportLibraryDeployer.DeployBusinessLogicAssemblies(IEnumerable`1 businessLogicAssemblies, DeploymentLogger logger) at Microsoft.Dynamics.Framework.Deployment.Reports.ReportLibraryDeployer.Deploy(IEnumerable`1 reportLibrariesToDeploy, IEnumerable`1 transitiveReferenceClosure, IEnumerable`1

Security Development Tools from Life cycle for MSD Ax 2012

Security Development Tools from Life cycle for Ax 2012 help us to see effect of  roles, duties, and privileges. You can download this tool from Dynamics life cycle services for Ax 2012 site. By using this tool you can easily test your newly create roles for forms,class,reports etc. This is free Downloadable tools section of Microsoft Dynamics Lifecycle Services.You need to have Account of MSN login. This tools  help you to save your time on test with different user login. You can get more details for this from below mention link.

Backdate validation for user control in EP MSD axapta

If you are seeking code for Backdate validation for user control in Enterprise portal page for  axapta then below code can help you. Its tricky to find code on EP so its helpful for you. string cDate1 = DateTime.Now.ToString("dd/MM/yyyy"); int flag = 0; Proxy.Info objinfolog = new Proxy.Info(this.AxSession.AxaptaAdapter); DateTime x; DateTime a; Int32 r1; Date1 = txtDate1.Text; Ir = dsTestNewForm.GetDataSourceView("TestNewForm").DataSetView.GetCurrent().GetRecord(); if (txtDate1.Text != "" && Ir.GetField("Date1").ToString() == "1/1/1900 12:00:00 AM") { x = DateTime.Parse(cDate1, new CultureInfo("en-CA")); a = DateTime.Parse(Date1, new CultureInfo("en-CA")); r1 = DateTime.Compare(a, x); if (Ir.GetField("Date1").ToString() == "1/1/1900 12:00:00 AM" && r1 < 0 && Date1 != "")

Get Current date from User control on Enterprise portal web page in Visual studio for MSD axapta

To Get Current date from User control for  Enterprise portal page in Visual studio for axapta you can set below code and show in message box. string cDate1 = DateTime.Now.ToString("dd/MM/yyyy"); Proxy.Info objinfolog = new Proxy.Info(this.AxSession.AxaptaAdapter); objinfolog.add(cDate1); You can include above code in your click event or as per your required event. This code you need to write in visual studio . You need to add particular user control in visual studio project then open code file to write the code.

The type or namespace name 'Portal' does not exist in the namespace MSD Ax 2009

Getting Error on build EP website in Visual Studio for Axapta 2009. The type or namespace name 'Portal' does not exist in the namespace 'Microsoft.Dynamics' (are you missing an assembly reference?). Solution: Solution for this error due to proxy classes required for this user control because its used in namespace. You need to take below step for the same. To fix  this error just go to your project and right click on the App_Code node in your solution explorer then select "Generate Proxies" option .  This process may take time for  building all of the classes from your proxy.  Now check again the build works for your project and its updated with your code. Proxy objects located on below folder. C:\inetpub\wwwroot\wss\VirtualDirectories\80\App_Code\Proxies

Sample code Example of Array in MSD Axapta

This is  Sample code  Example of Array in Axapta . str name; Array Arr = new Array (Types::String); int i= 1, j; Int test; TestTable TestTable; ; // Create an Str array // Write some elements in it while select TestTable { Arr.value(i, TestTable.TestTables);//(i, i*2); i++; } j = i; for (i = 1; i<j; i++) { test= Arr.value(i); while select TestTable where TestTable.TestTables == test { info(strfmt("%1", Arr.value(i))); } }

Job to import text file data to Table in MSD axapta

I want to share code to  import text file data to Table in axapta. Here is sample of one field taken in text file. #define.ioRead("r") Dialog dialog = new Dialog('File Upload'); Dialogfield dialogfield; DialogField dialogFileName; InventTable inventTable; ItemID itemID; FileIOPermission fileIOPermission; CommaTextIo io; container inLine; int lineNum; int i; ; dialogFileName = dialog.addField(typeid(FilenameSave)); dialog.run(); if(dialog.closedOk()) { fileIOPermission = new FileIOPermission(dialogFileName.value(), #ioRead); fileIOPermission.assert(); io = new CommaTextIo(dialogFileName.value(), #ioRead); if (io) { ttsbegin; while (io.status() == IO_Status::Ok) { inLine = io.read(); if (io.status() != IO_Status::Ok) {

Resolved - Workflow error during Order approval in MSD Axapta

Error Details:- Today I faced following error . Workflow instance:xxxxxxx was terminated for the following reason: No .NET Business Connector session could be found.. Due to this workflow work item not created after submission to workflow. Solution :To resolve this issue I did the following. 1.Compile application. 2.Resetting of IIS. 3. Reset Dotnet framework version on IIS if its changed by someone. 4. Recreate business connector configuration from Ax client configuration. This issue happen in Ax 2009 version and issue is now resolved .

Print Report in PDF in EP Site in MSD axapta 2009,4.0

If you are trying to print and display report in Enterprise portal in axapta then you need to add some code in class EPSenddocument on new method. case tablenum(CustPackingSlipJour): mailAddress = SalesTable::find(record.(fieldnum(CustPackingSlipJour,SalesId))).Email; if (record.(fieldnum(CustPackingSlipJour,InvoiceAccount))) StrVarialble1 = record.(fieldnum(CustPackingSlipJour,InvoiceAccount)); else StrVarialble1= record.(fieldnum(CustPackingSlipJour,OrderAccount)); documentTitle = fileName("SalesPKSLP"); reportName = reportstr(SalesPackingSlip); break; Here its example of sales packing slip report print . You need to add new case in switch statement.

Unable to back up the SQL Server Reporting Services encryption key for MSD ax 2012 R3

Solution on below error Problem and Error Reporting extension installation error for ax 2012 R3. Verifying the credentials for the Microsoft Dynamics AX .NET Business Connector proxy. Back up the SQL Server Reporting Services encryption key. The reporting server is not set up correctly, and cannot be configured by Setup. For information about setting up a reporting server, see SQL Server Books Online. An error occurred during setup of Reporting Services extensions. Reason: Unable to back up the SQL Server Reporting Services encryption key. The operation failed with error code 2147944645. System.InvalidOperationException: Unable to back up the SQL Server Reporting Services encryption key. The operation failed with error code 2147944645. at Microsoft.Dynamics.Setup.IdentityUpdater.<SetServiceAccount>b__2(ErrorCodes code) at Microsoft.Dynamics.Setup.IdentityUpdater.CheckHresult(Int32 hresult, Action`1 exceptionAction) at Microsoft.Dynamics.Setup.IdentityUpdater.SetServ

Get Product based on Item group in MSD Ax 2012

To get Item details or  Product based on Item group in Ax 2012 you can try below code in job. In this job Test_InventItemGroup is query on which you need to include inventItemgroupItem and inventTable. I have pass the range TT as item group same way you can use in your customization. Query query; QueryRun qr; QueryBuildDataSource qbds; QueryBuildRange queryBuildRange; InventItemGroupItem IntventTest,InventTest1; ; query = new Query(queryStr(Test_InventItemGroup)); qbds = query.dataSourceTable(tableNum(InventItemGroupItem)); queryBuildRange = qbds.addRange(fieldNum(InventItemGroupItem,ItemGroupId)); queryBuildRange.value("TT"); qr = new QueryRun(query); while(qr.next()) { IntventTest= qr.get(tableNum(InventItemGroupItem)); select ItemId from IntventTest1 where IntventTest1.ItemGroupId == IntventTest.ItemGroupId; info(strFmt("%1",IntventTest.ItemId)); }

Facing Error -failed to logon to Microsoft dynamics axapta in ssrs report for one user

I faced following error  on running ssrs report. Reports working for all user except one user. Error Description from Event log viewer. 1.Error No.1 An error has occurred in the services framework.  Method: AifMessageInspector::AfterReceiveRequest.  Error: System.ServiceModel.FaultException: Failed to logon to Microsoft Dynamics AX.    at Microsoft.Dynamics.Ax.Services.AxServiceOperationContext.InitializeSession()    at Microsoft.Dynamics.Ax.Services.AxServiceOperationContext.InitializeContext()    at Microsoft.Dynamics.Ax.Services.AxServiceOperationContext.Attach(OperationContext owner)    at System.ServiceModel.ExtensionCollection`1.InsertItem(Int32 index, IExtension`1 item)    at System.Collections.Generic.SynchronizedCollection`1.Add(T item) 2.Error No.2 An error has occurred in the services framework.  Method: AifMessageInspector::AfterReceiveRequest.  Error: System.ServiceModel.FaultException: Failed to logon to Microsoft Dynamics AX.    at Microsoft.Dynamics.Ax.

Right way to Reverse the voucher in MSD Ax 2012

There is Right way to Reverse the voucher in Ax 2012 you can try other option too. Click General ledger > Journals > General journal. Press CTRL+N to create a new voucher and click Lines to open the Journal voucher form. Click Functions and then click Load ledger transactions. Select the voucher type in the Voucher type field. The voucher type will provide the voucher number for the reversed voucher. Note:The voucher type should be of the reverse type to the original voucher smile emoticon . For example, if the original voucher type is Payment, the reversal voucher type must be Receipt. Select the Invert sign check box to activate the Reversal method field. In the Reversal method field, select a reversal option. Debit/credit – The original voucher is reversed by changing the debit entry to credit entry on the reversal voucher. +/- – The original voucher is reversed by inverting the amount signs on the reversal voucher. Click Select to open the Select form. Enter t

Error "not enough rights to use table 'company data' (data area) " in MSD Axapta

If you are facing following Error Error "not enough rights to use table 'company data' (data area) " in Axapta then you can try following steps. Solution : I tried to find security key for data area form but I am not able to get that because security key was not defined for that form. After long troubleshooting I got solution that user profile issue. So I restored user in Ax to repair user profile from domain. I hope you got the point what to do for this error.

Table structure change for Purchase order in MSD ax 2012

Table structure change for Purchase order in ax 2012 There are some Table structure change for Purchase order in ax 2012. In ax 2009 whatever purchase order made its directly insert to inventtrans table but in Ax 2012 there are some more table link. Initially data stored in purchtable and purchline table then purchline data inventtransid stored in InventTransOriginPurchLine table , Intermediate table between inventtrans and purchline is InventTransorigin. You can check relation between tables purchline ,InventTransOriginPurchLine,InventTransorigin and inventTrans . Once you create purchase order and facing any issue in po posting then you need to check data in mentioned tables. Relation mentioned in below tables