Alfasith AX

Alfasith AX
اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي، وَعَلِّمْنِي مَا يَنْفَعُنِي، وَزِدْنِي عِلْمًا

Sunday, October 26, 2014

Overcome from divide by zero error in AX

Hi,

2 ways.

>>
int    a,b,c;
if(b)
    c = a / b;
else
 print " Cannot divide by zero"

OR

c  = a / minOne(b);

//it returns a itself if b is zero because minOne() returns non zero values that we passes. If it is zero then it retuns 1

Above methods is to prevent the stoppage of flow of execution.

Regards,

Saturday, October 25, 2014

Code to get multi selected records in from grid in AX

Hi,

Make that object (button) to multiselect property as "YES".
on the control (button) event method (Clicked).

void clicked()
{

     int             ListOfRecIds, i=1;
    container  contains;
    CustTable  custTableLoc; // Table_Name  that we used in as the datasource.
    super();
   
    ListOfRecIds= custTable_ds.recordsMarked().lastIndex();
    custTableLoc= custTable_ds.getFirst(1);
   
   while (custTableLoc)
    {
        contains = conIns(container, i ,custTableLoc.AccountNum)
       custTableLoc = custTable_ds.getNext();
        i++;
    }
 }
Regards,

Saturday, October 18, 2014

Delete the model files from AX

Hi,

Open the command prompt > run > cmd
cd\
cd C:\Program Files\Microsoft Dynamics AX\60\ManagementUtilities
Above location is the AX installed location.

axutil delete /model:"Payroll model" /Config:MicrosoftDynamicsAx

Here model is the concern model that needs to be deleted
& Config is the AOS name.
Note: Unless you compile you will not find the difference.

Regards,

List out all the models installed in particular instance in AX

Hi,

Open the command prompt > run > cmd
cd\
cd C:\Program Files\Microsoft Dynamics AX\60\ManagementUtilities
Above location is the AX installed location.

axutil list /Config:MicrosoftDynamicsAx

Here Config is the AOS name.



Regards,


Friday, October 17, 2014

Creating SO(Sales Order) in AX 2012

Creating PO (Purchase order) in AX 2012

Date handling in AX 2012

Hi,

dateStartMth and dateEndMth in ax 2012

//Get day from date
dayOfMth(systemdateget())

//Get month from date
mthOfYr(systemdateget())

//Get year from date
year(systemdateget())

// Ger Ist date of the month
dateStartMth (DueDate); // If DueDate = 18\11\1989 this method returns 01\11\1989

// Get Last date of the month
dateEndMth (DueDate) // If DueDate = 18\11\1989 it returns 30\11\1989

// Get no of months between the 2 dates.
noOfMonths =  intvNo(Date1, Date2, intvScale::Month);

// Get no of month between 2 dates belongs to 2 different year.
noOfMonths =  intvNo(Date1, Date2, intvScale::YearMonth);


//for next month
dateLoc = nextMth(today());

//for prevous month
dateLoc=prevMth(today());

//for next year
dateLoc=nextYr(today());

//for previous year
dateLoc =preYr(today());

//4 month before
dateLoc=prevQtr(today());

//4 month after
dateLoc=nextQtr(today());

Regards,

Free dumps for microsoft certification(prometric certification)

Hi,

Below URL takes you to the dump store.(Its non authorized page but useful).
http://www.examcollection.com/

Regards,

Tuesday, October 14, 2014

String Handling in AX

Hi,

    str 100     mailBody = 'Mohamed Alfasith IsmailSuban';
    if(strScan(mailBody,'Suban',1,strLen(mailBody)))
// Checks the presence of the string
       print strreplace(mailBody,'Suban',"Mohamed");
//Replaces the substring in main string...
 
//Delete the first letter in AX
strDel("Dynamic AX",1,1); // it retuns "ynamic"

subStr("Alfasith",3,5); //Returns the string 'fasit'.
strUpr("Alfaith"); // Returns the string ALFASITH
strRTrim("*AX*"); //Returns "*AX". removes the space in right end
strLTrim("*AX*"); //Returns " AX*". removes the space in left end

str mytxt = "Mohamed\nAlfasith\nIsmail"; // here \n is the new line escape sequence
print strLine(mytxt,1); // this prints only Mohamed

strLen("Fasith"); // returns 6

strRep('Ala',5); //  returns AlaAlaAlaAlaAla

Regards

Saturday, October 11, 2014

Convert UTCDateTime to date & date to UTCDateTime in AX

Hi,

    print DateTimeUtil::newDateTime(today(), 0, DateTimeUtil::getCompanyTimeZone());
    // Here today() is the date format not utcdatetime format...


    print DateTimeUtil::date(UTCFieldValue);
    // Here UTCFieldValue is theUTC date time field...


    //Get date diff from 1 UTC date time and another date type in AX
    return DateTimeutil::getDifference(
                        DateTimeUtil::newDateTime(resRentAgreement.StartDate, 0,       DateTimeUtil::getCompanyTimeZone()),
                        resGracePeriodHistory.createdDateTime))
// here resRentAgreement is the date field and resGracePeriodHistory is UTCDateTime field.

Regards,

Saturday, October 4, 2014

Microsoft ebooks free download

Hi,

Microsoft free e-books are available at.

http://blogs.msdn.com/b/microsoft_press/archive/2011/03/03/ebooks-list-of-our-free-books.aspx

Regards,

Free dot net (*.net) frame work download

Dear,

.net frame works *.exe files from MS office official page download center.

.NET Framework 4.5 Setup
.NET Framework 4.0 Setup
.NET Framework 3.5 Setup
.NET Framework 3.5 Setup Service Pack 1
.NET Framework 3.0 Setup
.NET Framework 2.0 Setup
.NET Framework Client Profile Offline Installer

Regards,


Code to check document is attached in AX

Hi,

static void AlfasithCheckAttacheddocu(Args _args)
{
    PurchTable             PurchTable; //Table your concern
    DocuRef                 DocuRef;
    ;
    select purchTable where purchTable.PurchId == "112255"; // Table your concern
    select DocuRef where DocuRef.RefTableId == PurchTable.TableId
                    &&  DocuRef.RefRecId == PurchTable.RecId;
   
    info(DocuRef.Name);
    pause;
}

Regards,

Difference between Microsoft dynamic AX 2012 with Dynamic AX 2009. Microsoft white paper

Hi,

Difference between Microsoft dynamic AX 2012 with Dynamic AX 2009.

http://www.microsoft.com/en-us/download/details.aspx?id=7225

This document provides a summary of new and changed features that have been implemented in Microsoft Dynamics AX 2012, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012 R2, and Microsoft Dynamics AX 2012 R3. It also describes companion apps and tools and services that support AX 2012. It also includes deprecated feature notices that describe features that have been removed in an

Regards,

How find size of recordsortedlist in D365/AX 2012

Hi, This is the continuity of the previous article where we are now getting the size of recordsortedlist . if(recordsortedlist.len() >1) ...