Skip to main content

Posts

Showing posts from June, 2013

Dialog field lookup method

Hi ,   Dialog forms are extends with Runbase class or Runbasebatch class ,In this class dialog fields are added in dialog method for these dialog fields we can write a lookup method in below manner void Fld9_1_lookup()  {     Formrun fr = dialog.formRun();     object Control = fr.controlCallingMethod();     SysTableLookup       sysTableLookup = SysTableLookup::newParameters(tablenum(EmplTable),  dialogEmployee.fieldControl());     Query                query = new Query();     QueryBuildDataSource queryBuildDataSource;     queryBuildRange         maintenancesection;     ;     sysTableLookup.addLookupfield(fieldnum(EmplTable, EmplId));     SysTableLookup.addLookupMethod(identifierstr(name)); ...

How to send Normal AX Reports to User through Batch Process in Dynamics Ax 2009.

Hi friends, Recently I got one requirements from my User, I.e. customer want to see ax reports in E-mail everyday once through batch process. its just like send mail from batch process only, But we need to work on how to send normal report. 1) write the class with below methods mandatory.           2)Here am going to post logic for how to convert ax report to PDF and how to send the email to user only. // Saved the reports into particular location void SaveReport() {     Args args;     ReportRun rr;     str reportName = "OpenPurchOrderLine_Vendor";     str myPath;     int i;    ;    i = 1;   args = new Args(reportName);   args.caller(rr);   rr = new reportRun(args);     rr.query().interactive(false);     rr.report().interactive(false);   ...

Full Text Index in Dynamics AX 2012

Hi Friends, Full text index supports to quickly query words that are embedded in the middle of a string field of a table. Well, this is a very nice enhancement to query on Database table fields for the developers who work with the latest vesion [Microsoft Dynamics AX 2012] Good thing is we can use this Index on Memo fields and also Extended data type. Let me explain with an example. Create a new table as shown below and add a new field of type string “Name” to it – On the field use EDT – Name. In the below example, my table Name is SR_FullTextExample. Once you are done with your table, Go to FullTextIndex Node >> Right click and create a new FullTextIndex. Rename it to NameFullTextIndex. Drag and drop Name field from the fields to the newly created index. The table with index should look like below. The following X++ Job uses a full text index that exists on a table and field that it queries. static void FullTextExamp(Args _args) { ...

How to retrieve multiple selected records from Grid using X++ in Axapta

Hi Friends, In this post, we discuss how we can retrieve all selected(marked) records of a datasource or retrieve marked records form Grid. For this purpose follow the steps listed below. Create a new table named " TabPet " that contains two string fields i.e. Name & ID. Create a new form and add the newly created "Student" table in the datasource node. Next create a new button on the form, set its multiselect property to " Yes " . Now override the clicked method of the button and add the following code. Code snippet     int             recordsCount;     TabPet      TabpetLocal;     super();          recordsCount =  TabPet  _ds.recordsMarked().lastIndex();  // Total number of marked records.      TabpetLocal =  TabPet _ds.getFirst(1);          while ( TabpetLocal )     {         info( Tabp...

Convert word Documents into PDF report [using X++ in Dynamics AX 2009]

Hi Friends, This is the way we can convert word format report into PDF in ax2009 static void dsiple_PDS(Args _args) {     Args args;     ReportRun rr;     str reportName = "ReportName";     PurchRFQLine rfqLineTable;     str myPath;     str pdfFileName;     int i;     COM wordApplication;     COM wordDocuments;     COM wordDocument;     COM wordRange;     str a[];     str path;     str pdfPath;     str finalPath;     int length;     int minus;     ;     i = 1;     myPath = winApi::getTempPath();     info(myPath);     args = new Args(reportName);     args.caller(rr);     //rr =...

Open the Listpage form from another form by passing parameter in axapta 2012

In axapta 2012 all the common forms are listpage forms , In list page form we can't override any method so any validation can be done through ListpageInteraction Class . My intention is open the Listpage form from another form, so for that  we need to change the code in InitializeQuery   method of ListpageInteraction class. 1) Override the clicked method of menuitembutton of Calling form ex: FormRun formRun; Args args = New Args(); super() args.name(EAMWorkRequestListPage); args.parmEnum(EAMWorkstatus::WaitingForAuthorization); formRun = ClassFactory.formRunclass(args); formRun.init(); formRun.run(); formRun.wait()   2) Based on passing enumvalue the Listpage will be filtered by overriding the InitializeQuery method of ListpageInteraction class.   if (this.listPage().listPageArgs() && this.listPage().listPageArgs().enumParameter())     {         status = this.listPage().lis...