Skip to main content

Posts

Showing posts from November, 2011

How Group by clause work in MSD Axapta x++

How Group by clause work in Axapta x++ If we use group by clause in ax then we should know how it work . for example select tabletest group by testno,testgroup; it means you will get record by grouping of testno and testgroup but it there is no field selected that means its internally two fields testno,testgroup is in select query means actual query working like this. select testno,testgroup from tabletest group by testno,testgroup; you can also select group by clause with while like this while select tabletest group by testno,testgroup { statements; ----------- ---------- } if we take aggregate funtion with group by clause like this select count(recid) from tabletest group by testno,testgroup; then actual query will work like this select count(recid),testno,testgroup from tabletest group by testno,testgroup;

AOS tasks in Microsoft dynamics Axapta MSDAX

AOS Tasks • X++ run time: It runs the X++ code which provides most of the business logic in Microsoft dynamics AX. • Security: It enforces security to manage access to data and functionality. Record level security • Session management: It manages client sessions. • Web services: It is a web service endpoint.

SQL Error can not select record from table abc in MSD axapta

Some times we face this error which is SQL Error " can not select record from table abc " in axapta application. This error comes due to some index problem or record duplication in table to resolve this problem we can do following. 1. Find index which creating problem you can re index that index. 2. Restore table using right click on table restore option. 3. Synchronize table if problem still not resolved. 4. If problem still not resolved then try to synchronize whole data dictionary in AOT. 5. If you are facing problem due to duplication of records then try to delete duplicate records. By using above steps I hope your problem will resolve.

User name and password screen form for MSD axapta applicaiton

User name and password screen form for axapta applicaiton: If you want to set separate login screen for axapta application then its very difficult to implement but I want to share some hint to help you because this things is in high demand. 1. First you can create table for login details with field user-id and password. extended data type for user id should be userid to select user id for password you can set property password type to yes then you can use different event to maintain password in * character through code. 2. Create login form to enter login details to store it. 3. Create another login form put control for userid and password to check from table you can write validation code on that form. 4. put that form in display menu. 5. call that login form in  application class in start-up post method. this will work if everything done well.

Send report to email using batch process in MSD axapta

Send report to email using batch process in axapta To send any report to particular email of person throgh batch process we need to follow folloing steps and points 1. set email parameter set outgoing email,local host, user name and passwords. 2. set email template there you can give sender name,email, description,language etc. 3. set email in report dialog and select pdf print option, 4 . Make sure server is added to allow send mail etc in different applications which restrict to send email through axapta batch process. 5. set reccurence in batch process of report to set time etc. if you do all those steps completely than you can get success in this task .

Example of validate method in MSD Ax using language x++

Example of validate method in Ax using lanugage x++ void clicked() { super(); if(str2num(rlSrNo_Update.valueStr()) == 0) { Warning("Not Valid Roll No"); } else if(strEmployeeName_Update.valueStr() == "") { Warning("Pleae Enter Employee Name"); } else if(cmbTravellingThrough_Update.selection() == test_Travelling_Through::None) { Warning("Pleae Enter Traveling Through"); } else { element.Update_test_Emp_Travel(); } }

Update records and grid in MSD axapta x++ language

Update records and grid in axapta x++ language public void Update_test_Emp_Travel() { ; ttsbegin; Select forUpdate test_Emp_Travel where test_Emp_Travel.SrNo == str2num(rlSrNo_Update.valueStr()); test_Emp_Travel.Employee_Name = strEmployeeName_Update.valueStr(); test_Emp_Travel.Travelling_Through = str2enum(test_Travelling_Through,cmbTravellingThrough_Update.valueStr()); test_Emp_Travel.update(); ttscommit; test_Emp_Travel_ds.reread(); test_Emp_Travel_ds.refresh(); test_Emp_Travel_ds.research(true); test_Emp_Travel_ds.executeQuery(); element.ClearField_Update(); GridEmpTravel.update(); GridEmpTravelDetails.update(); }

Insert Records and update grid in MSD axapta

 Insert Records and update grid in axapta x++ public void Insert_test_Emp_Travel() { ; test_Emp_Travel.SrNo = str2num(rlSrNo.valueStr()); test_Emp_Travel.Employee_Name = strEmployeeName.valueStr(); test_Emp_Travel.Travelling_Through = str2enum (test_Travelling_Through,cmbTravellingThrough.valueStr()); test_Emp_Travel.insert(); test_Emp_Travel_ds.reread(); test_Emp_Travel_ds.refresh(); test_Emp_Travel_ds.research(true); test_Emp_Travel_ds.executeQuery(); element.ClearField_Insert(); GridEmpTravel.update(); GridEmpTravelDetails.update(); }

The number to convert to a text string using MSD axapta x++

num2Str info("num2Str(real number,int character,int decimals,int separator1,int separator2)"); info("number - The number to convert to a text string."); info("character - The minimum number of characters required in the text."); info("decimals - The required number of decimals."); info("separator1 - The decimal separator. Possible values: 1 – point (.) and 2 – comma (,)"); info("separator2 - The thousands separator. Possible values: 0 – no thousands separator ,1 – point (.) ,2 – comma (,) ,3 – space ( )"); info("num2Str(12345.6,1,2,1,2) " + num2Str(12345.6,1,2,1,2));   

Dialog in Report using MSD axapta x++ language

Dialog in Report //1. Class Declaration public class ReportRun extends ObjectRun { dialogField dftest_Enum_EDT; dialogField dfFromDate,dfToDate; dialogGroup dialogGroup; test_Enum_EDT test_Enum_EDT; Date dtFrom,dtTo; str strtest_Enum_EDT; } //2. Dialog public Object dialog(Object _dialog) { DialogRunbase dialog = _dialog; ; dialogGroup = dialog.addGroup("DialogGroup"); dftest_Enum_EDT = dialog.addField(typeid(test_Enum_EDT)); //dialog.addFieldValue(typeid(test_Enum_EDT)); dfFromDate = dialog.addField(typeId(FromDate));//dialog.addFieldValue(typeId(FromDate),dtFrom); dfToDate = dialog.addField(typeId(ToDate));//dialog.addFieldValue(typeId(ToDate),dtTo); return dialog; } //3. getFromDialog public boolean getFromDialog() { ; strtest_Enum_EDT = dftest_Enum_EDT.value(); test_Enum_EDT = dftest_Enum_EDT.value(); dtFrom = dfFromDate.value(); dtTo = dfToDate.value();

Overwrites part of a text string with another text string in MSD axapta x++

strPoke (Overwrites part of a text string with another text string) info("str strPoke(str _text1,str _text2,int _position)"); info("Overwrites part of a text string with another text string."); info("_text1 - The original string."); info("_text2 - The string to replace part of _text1 with."); info("_position - The position in _text1 at which to begin replacing the characters."); info("strPoke(\"123456\",\"AAA\",3) " + strPoke("123456","AAA",3));

Retrieves part of a string in axapta x++

 subStr (Retrieves part of a string) info("str subStr(str _text, int _position, int _number)"); info("Retrieves part of a string."); info("_text - The original string."); info("_position - The position in _text to begin the new string."); info("_number - The number of characters to select from _position onwards."); info("subStr(\"ABCDEFG\",2,4) " + subStr("ABCDEFG",2,4)); info("subStr(\"ABCDEFG\",5,-3) " + subStr("ABCDEFG",5,-3));

Remove particular chars from a string in MSD axapta x++

 strRem (Removes particular chars from a string) info("str strRem(str text1, str text2)"); info("Removes the characters specified in one text string from another text string."); info("text1 - The original text string."); info("text2 - The text string you want to remove the letters from."); info("strRem(\"ABCDEFGABCDEFG\",\"ACEG\") " + strRem("ABCDEFGABCDEFG","ACEG"));

Delete excluded characters in MSD axapta

 strKeep (Delete excluded chars) info("str strKeep(str _text1, str _text2)"); info("Deletes all of the characters in a text string that are not included in another text string."); info("_text1 - The first text string."); info("_text2 - The characters to keep in the first text string."); info("strKeep(\"ABBCDDEFGHB\",\"BCD\") " + strKeep("ABBCDDEFGHB","BCD"));