Date Calculation :
static void DateCalcu(Args _args)
{
TransDate fromDate,toDate;
int reqDays;
;
fromDate = mkdate(01,07,2011);
toDate = mkdate(19,06,2011);
if(fromDate && (toDate > fromdate))
{
reqDays = todate - fromDate;
}
else
{
throw error(strfmt("To-date %1 must be greater than from-date %2",todate,fromdate));
}
info(strfmt("%1",reqDays));
}
Popular Posts
-
Display Method: Take the new method in a table display Name names() { CustTable custTable; ; return Cust...
-
Difference Between Array and Container : Array : 1 . In this array are single dimension. 2.You can define array in only sing...
-
Pack and unpack Pack this method is a standard method inherited from RunBase. It is used to save the values that the user selects and s...
-
Exist Method : static boolean exist(ItemId itemId)--->this is key which is primary { return itemId && (select RecId from ...
-
static void nestingExcel(Args _args) { SysExcelStyles styles; SysExcelStyle style; SysExcelFont ...
-
Copy of the data from one table to another Table:- Insert_recordset copyOfStudents (ID, Name, ClassName) à here where the data is copied ...
-
Ax Number Sequence : ClassDeclaration: NumberSeqFormHandler numberSeqFormHandler; Close: void close() { if (numberSeqFormHandl...
-
Posting Journals static void Journal_Kis(Args _args) { InventJournalTable journalTable; InventJournalTrans journalTra...
-
suppose they are 3 field in enum one value is shown in form and another form is used in another form .we put the filter in datasource-->i...
-
see this link http://www.4shared.com/dir/W-Aitz4u/Axapta_Video.html
Tuesday, 19 July 2011
Thursday, 14 July 2011
to filtering form by the enum values(which is n't shown in form)
suppose they are 3 field in enum one value is shown in form and another form is used in another form .we put the filter in datasource-->init method write the following code.
this.query().dataSourceTable(tablenum(inventtable)).addRange(fieldnum(inventtable,lltype)).value(enum2str(lltype::Both));
this.query().dataSourceTable(tablenum(inventtable)).addRange(fieldnum(inventtable,lltype)).value(enum2str(lltype::Both));
find and exit methods in tables
Exist Method:
static boolean exist(ItemId itemId)--->this is key which is primary
{
return itemId && (select RecId from inventTable -->table name
index hint ItemIdx--->index name in table
where inventTable.ItemId == itemId
).RecId != 0;
}
Find Method:
static InventTable find(ItemId itemId,
boolean update = false--->to define how many primarykeys in table )
{
InventTable inventTable;
;
inventTable.selectForUpdate(update);
if (itemId)
{
select firstonly inventTable-->table name
index hint ItemIdx-->index name
where inventTable.ItemId == itemId;
}
return inventTable;
}
static boolean exist(ItemId itemId)--->this is key which is primary
{
return itemId && (select RecId from inventTable -->table name
index hint ItemIdx--->index name in table
where inventTable.ItemId == itemId
).RecId != 0;
}
Find Method:
static InventTable find(ItemId itemId,
boolean update = false--->to define how many primarykeys in table )
{
InventTable inventTable;
;
inventTable.selectForUpdate(update);
if (itemId)
{
select firstonly inventTable-->table name
index hint ItemIdx-->index name
where inventTable.ItemId == itemId;
}
return inventTable;
}
Wednesday, 6 July 2011
display records from different company accounts in one form
display records from different company accounts in one form
One of the previous posts on this blog discussed getting records from different company accounts with one select statement. For this, the crossCompany keyword is used.Now we'll do something similar, but this time we'll display the records in a form. And the good news is, it's really easy. All ya have to do, is set a property on the datasource of the form.
You can use the crossCompanyAutoQuery property, located on the forms datasource. Standard value is 'No', so set it to 'Yes'
control:: enum on forms
control:: enum on forms
A somewhat non-intuitive way of accessing controls on a form is using a built in enum named ‘control’. This enum automatically contains all controls of you form (tabs, buttons, etc), and you can reference them by name.
So, if for example your button is called ‘ButtonFunctions’, you can set the property ‘enabled’ to false like this:
element.control (Control::ButtonFunctions).enabled (false);
The main advantage here is that you don’t have to set the property autodeclaration to yesRename an AX company on SQL
Rename an AX company on SQL
A while ago, I talked about deleting an AX company on SQL, but of course, you can also use the sp_MSforeachtable stored procedure to rename a company (= change the DataAreaId of a company).
In the next example, I rename CEE to CEA:
exec sp_MSforeachtable ‘update? set DataAreaID = "CEA" where? DataAreaID = "CEE"'UPDATE DataArea SET ID = 'CEA' WHERE DataArea.ID = 'CEE'
UPDATE CompanyDomainList SET CompanyID = 'CEA' WHERE CompanyID = 'CEE'
Ax Application File Extence
Application file extensions
Dynamics AX uses a lot of file extensions, but luckily, there is logic to them, so you can easily identify their purpose.
Most of these files are located in the application folder (AX 2009):
C:\Program Files\Microsoft Dynamics AX\50\Application\Appl\ [your_application]
C:\Program Files\Microsoft Dynamics AX\50\Application\Appl\ [your_application]
The extensions have 3 characters:
The first character indicates the owner of the file:
The first character indicates the owner of the file:
a: application
k: kernel
k: kernel
The second character indicates the content of the file:
l: label
o: object
t: text
d: developer documentation
h: help
o: object
t: text
d: developer documentation
h: help
And the third character indicates the type of file:
d: data
i: index
c: cache
t: temporary
i: index
c: cache
t: temporary
Using this logic, we can easily name all file extensions, and understand their purpose.
In the application folder:
ALD extension: Application Label Data files
These files contain the labels and label comments for a specific language of a label file.
ALD extension: Application Label Data files
These files contain the labels and label comments for a specific language of a label file.
ALC extension: Application Label Cache files.
These files contain the application label cache. These files can be deleted when the AOS is stopped.
These files contain the application label cache. These files can be deleted when the AOS is stopped.
ALI extension: Application Label Index files.
The .ali files contain an index to the .ald files. These files can be deleted when the AOS is stopped.
The .ali files contain an index to the .ald files. These files can be deleted when the AOS is stopped.
ALT extension: Application Label Temporary files.
These files contain new labels before they are committed to the .ald file.
These files contain new labels before they are committed to the .ald file.
AOI extension: Application Object Index file
The AOI file contains an index to the AOD files. You can delete this file when the AOS is stopped. Be sure to delete this when you have copied layers from one AX installation to another.
The AOI file contains an index to the AOD files. You can delete this file when the AOS is stopped. Be sure to delete this when you have copied layers from one AX installation to another.
ADD extension: Application Developer Documentation Data files.
These files contain the documentation that is found under the Application Developer Documentation node. These files are localized, just like label files.
These files contain the documentation that is found under the Application Developer Documentation node. These files are localized, just like label files.
ADI extension: Application Developer Documentation Index files.
This is the index to the ADD file.
This is the index to the ADD file.
AHD extension: Application Help Data files
The AHD file contains the documentation aimed at the end user. In the AOT, this is found in the “Application Documentation” node.
The AHD file contains the documentation aimed at the end user. In the AOT, this is found in the “Application Documentation” node.
AHI extension: Application Help Index files.
This is the index to the AHD file.
This is the index to the AHD file.
AOD extension: Application Object Data file.
This is the ‘AX layer file’; each of these files represents one layer.
This is the ‘AX layer file’; each of these files represents one layer.
KHD extension: Kernel Help Documentation files.
These files contain the kernel help documentation you can find in the AOT in the tree node System Documentation.
These files contain the kernel help documentation you can find in the AOT in the tree node System Documentation.
KHI extension: Kernel Help Index files
The KHI file is the index to the Kernel Help file.
Located in Server/bin:
KTD extension: Kernel Text Data file.
This file contains system text strings. These are used in the interface of AX and for system messages.
KTD extension: Kernel Text Data file.
This file contains system text strings. These are used in the interface of AX and for system messages.
KTI extension: Kernel Text Index file.
This is the index to the KTD file.
This is the index to the KTD file.
Filter On lookups using relations & method
Filter lookup based on enums using relations :
Method: 1
Method: 2
Remove the EDT on ItemId it filters automatically based on ItemType
PerformLookup:
Write this method in Table:
Static FormRun itemRecruitingIdLookup(FormRun lookupFormRun, FormControl _ctrl)
{
FormDataSource formDataSource;
Query formquery;
;
formDataSource = lookupFormRun.objectSet();
formquery = formDataSource.query();
formquery.dataSourceNo (1).addRange (fieldnum (InventTable, ItemType)).value (queryValue (ItemType::BOM));
return lookupFormRun;
}
In form datasource field method write the following code:
public void performFormLookup(FormRun _p1, FormControl _formControl)
{
Super (HRMApplication::hrmRecruitingIdLookup (_p1), _formControl);
}
Subscribe to:
Posts (Atom)