6 Haziran 2013 Perşembe

AXAPTA - Begin and end of the day

     info( strfmt("%1 --- %2", datetobeginUtcDateTime( today() , DateTimeUtil::getUserPreferredTimeZone() ) ,
        datetoendUtcDateTime( today(), DateTimeUtil::getUserPreferredTimeZone() )));

23 Mayıs 2013 Perşembe

AXAPTA - Copy to clipboard

FileIoPermission _perm = new FileIoPermission("myfile.txt",'r');
TextBuffer txtBuff = new TextBuffer();
;
// from text file
_perm.assert();
txtb.fromFile("myfile.txt");
txtBuff.toClipboard();
// from string
txtBuff.setText("my test buffer...");
txtBuff.toClipboard();

19 Nisan 2013 Cuma

AXAPTA - Show company logo at reports

First you  have to upload company logo. For this:

From Basic->Setup->Company informations->Company logo upload your logo.

After that write code below which I found from  this address  as display method:

Display Bitmap CompanyLogo()
{
    CompanyInfo companyInfo = CompanyInfo::find();
    ;
    return CompanyImage::find(companyInfo.DataAreaId, companyInfo.TableId, companyInfo.RecId).Image;
}


Pull this method to header. Don't forget arrange Height and Width values manual and change ResizeBitmap property to Yes.

25 Mart 2013 Pazartesi

AXAPTA Read text file

...
    Filename                Filename;
    System.IO.StreamReader  readFile;
    System.String           line;

    int hwnd; 
    ; 
    hwnd = infolog.hwnd(); 
    Filename = WinApi::getOpenFileName(hwnd,['TXT files','*.txt'],"","Text Files");
//    Filename = WinApi::getOpenFileName(element.hWnd(),['TXT files','*.txt'],"","Text Files");
    if (!Filename)
        return;

    readFile = new System.IO.StreamReader(filename,System.Text.Encoding::get_UTF8());
    while (true)
    {
        line = readFile.ReadLine();

        if(System.String::IsNullOrEmpty(line))
           break;
        warning(line);
    }
       
    readFile.Close();
    readFile.Dispose();
...        



There are other ways, one of them is at Fatih Demirci's blog.

8 Şubat 2013 Cuma

6 Şubat 2013 Çarşamba

4 Şubat 2013 Pazartesi

AXAPTA - Catch tabbed dialog enter and exit

Use  pageActivated() for catch enter tabbed dialog, use allowPageDeactivate() for catch exit. I tried to use Lostfocus() and GotFocus() with no success.