Alfasith AX

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

Saturday, May 24, 2014

Upload image in to form / Application photo in Dynamic Ax

Hi,

// Use this below code in clicked method for your button placed in form.
str filename;
FileNameFilter filter = ['JPG files','*.jpg'];
Bindata binData;
Image signatureImage = new Image();

super();

filename = Winapi::getOpenFileName(element.hWnd(), filter, '', "Upload your image", '', '');

binData = new BinData();

if (binData.loadFile(filename))
{
    signatureImage = binData.getData();
    WindowField.image(signatureImage); // WindowField - is the window field and make it auto declaration  : Yes
    WindowField.widthValue(signatureImage.width());
    WindowField.heightValue(signatureImage.height());
    element.resetSize();
    element.unLock();
}
Note:  this code stows the record but not stores the record in table.

Regards,

No comments:

Post a Comment

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) ...