Creating Dialogs

Dialogs are a way to present users with a simple input form. They are commonly used for
small user tasks like filling in report values, running batch jobs, presenting only the most
important fields to the user when creating a new record, etc. Dialogs are normally created
from X++ code without storing actual layout in AOT.
The application class Dialog is used to build dialogs. Other application classes like
DialogField, DialogGroup, DialogTabPage, and so on, are used to create dialog
controls. One of the common ways is to use dialogs within RunBase framework classes that
need user input.

Read more

Importing from an XML file

The exporting to an XML file recipe has already explained the importance of XML in Dynamics
AX, and how XML documents could be used for exporting data from the system.
In this recipe, we will continue about XML. We will create a piece of code that reads XML files.
As a source file, we will use the previously created accounts.xml file.

How to do it…

Read more

Exporting to an XML file

Briefly, Extensible Markup Language (XML) defines a set of rules for encoding documents
electronically. It allows creating of all kind of structured documents. In Dynamics AX, XML
files are widely used across the application. For example, user profiles can be exported as
XML files. Business data like financial statements can also be exported as XBRL (eXtensible
Business Reporting Language) files, which are based on XML.

Read more

Building a query object

Query objects are used to visually build SQL statements. They are used by Dynamics AX
reports, views, forms, and other objects. Normally queries are stored in AOT, but they can also
be created from code dynamically. This is normally done when visual tools cannot handle
complex and dynamic queries. In this recipe, we will create one dynamically from code.
As an example, we will build a query that selects all active customers who belong to group 10
and have at least one sales order.

How to do it…
1. Open AOT, create a new job called CustTableSales, and enter the following code:

Read more

Copying a record

Copying a record
I’ve experienced that one of the tasks often used when manipulating data is record copying.
For various reasons, an existing record needs to be modified and saved as a new one. The
most obvious example could be when a user requires a function that allows him or her to
quickly duplicate records on any of the existing forms.
There are several ways of copying one record into another in X++. In this recipe, we will explain
the usage of table data() method, global buf2buf() function, and their differences. As an
example, we will copy one of the existing customer records into a new one. Normally, copying
a customer involves more data around the customer like customer contacts, bank accounts,
printing settings, and similar, but for demonstration purposes, we will assume that our goal is
only to copy the customer record itself without worrying about related data.
How to do it…

Read more

Using a normal table as temporary table

Standard Dynamics AX contains numerous temporary tables, which are used by the
application and could be used in custom modifications too. Although new temporary tables
could also be easily created using AOT, sometimes it is not effective. One of the cases could
be when the temporary table is very similar or exactly the same as an existing “real” one. The
goal of this recipe is to demonstrate an approach to how standard non-temporary tables could
be used as temporary.

Read more

Çağıran formdaişlem yapmak

Merhaba

Buton ile bir formdan başka bir forma geçtiğinizde diğer forma otomatik olarak önceki form nesne olarak aktarılır. Şöyle örnekleyelim. A formundan bir buton ile B formunu açtınız. B formunda bazı değişikler yapıp kapatırken A formunun bir metodunu çağırmak istiyoruz. Örneğin yenileme işlemi yapan bir metodunu çağıralım. Bu işlemi Args nesnei sayesinde yapabiliyoruz.

B formunun ClassDecleration metoduna şu değişken tenımını yapalım;

object callerForm;

B formunun init() metoduna şu kodu ekleyelim ;

callerForm = element.args().caller();

Artık A formu elimizde isteğimiz yerde bildiğimiz herhangi bir metodunu çağırabiliriz.

A formunda veri kaynağını güncelleyen bir metod olsun

void FDRefreshDS()
{
veriKaynagi_DS.executeQuery();
}

B formunun close() metoduna A formunun FDRefreshDS() metodunu çağıran bir kod ekleyelim.

callerform.FDRefreshDS();

Böylece açtığımız formdan bir önceki forma ulaşmış olduk.

Selamlar.

Çağıran formdaki kayıdı alma metodu

Merhaba

Bir formdan başka bir formu açtırdınız. Üzerinde  olduğunuz kaydı açılan formda kullanmak isterseniz  args()  fonksiyonlarını kullanabilirsiniz.

Öncelikle değişkeni tanımlamak gerekiyor.

CustTable  custTable;

Daha sonra  formun init() metoduna şu kod yazılır.

Read more

Dialogdan alınan tarihleri range olarak query’ye eklemek

Merhaba

Rapor yaparken diyalog alanından aldığınız başlangıç ve bitiş tarihlerini nasıl query’e range olarak ekleneceğini anlatacağım .

Öncelikle  classdecleretaion da  değişkenlerimizi tanımlayalım.

      public class ReportRun extends ObjectRun
      {
         DialogField      dfStartDate;
         DialogField      dfEndDate;

         TransDate        startDate;
         TransDate        endDate;

      }

Daha sonra dialog metodunda şunları yazalım

Read more

Axapta’da FTP işlemleri

Ax içinden uzaktaki bir FTP adresine ulaşarak dosya işlemlerini gerçekleştirme.

WinInet class’ına ihtiyaç duyar. xpo olarak içeri aktarabilirsiniz.

İndirmek için tıklayın

Read more