Alfasith AX

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

Wednesday, April 24, 2024

How find size of List in D365/AX 2012

Hi,

public int listLengthCounter(List list)
{
Enumerator enumerator;
int length = 0;
;
enumerator = list.getEnumerator();
while(enumerator.moveNext())
{
length++;
}
return length;
}

But List has such a direct funtion


 if (list.elements() > 1) 
    { 
        print "It has has more than 1 elements"; 
    } 

Thanks

Monday, April 8, 2024

FileNameSplit() to slip the Directory, file name and extension in D365 FnO

 Hi,


    /// <summary>
    /// Validate the Fileformat
    /// </summary>
    /// <param name = "filepath">FilePath</param>
    /// <returns>Boolean</returns>
    public boolean validateFileExtension(str filepath)
    {
        str         actualFileName, fileExtension, actualFilePath;
        boolean     ok = true;
 
        [actualFilePath,actualFileName, fileExtension] = fileNameSplit(filePath);
 
        ok = strScan(actualFileName,allowedFileNameFormat,1,strLen(actualFileName));
        if(!ok)
        {
            Error("@SUNR:FileDoesntExisit");
        }
 
        return ok;
    }


Regards,


SQL code to upate one Legal entity banner to all the legal entity in D365

 Hi, update companyimage set  companyimage.Image  = companyimageA.Image  from  ( select Image from companyimage where dataAreaid = 'USF...