Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 175888

Save Selected Image in Table

$
0
0
static void ImageField1(Args _args)
{
    BinData binData = new BinData();
    A_ImageTable table;
    dialog               d;
    Dialog                      dialog = new dialog();
    dialogField                 dialogFilename;
    FileName                    fileName;
    container imageContainer;
    str imageFilePathName;
    
    d = new dialog();
    d.caption("select a file");
    dialogFilename = d.addField(extendedTypeStr(FilenameOpen),"File Name");//add a field where you select your file in a specific path
    d.run();//execute dialog
        if(d.closedOk())
        {
            filename = dialogFileName.value();//return path file value    
        }
    imageFilePathName=filename;
        if ( WinAPI::fileExists(imageFilePathName))
        {
            binData.loadFile(imageFilePathName);
            imageContainer = binData.getData();
            table.Image = imageContainer;
            table.insert();
        }
}

Viewing all articles
Browse latest Browse all 175888

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>