static void ImageField(Args _args) { BinData binData = new BinData(); A_ImageTable table; container imageContainer; str imageFilePathName; imageFilePathName="C:\\Users\\Public\\Desktop\\diwali.jpg"; if ( WinAPI::fileExists(imageFilePathName)) { binData.loadFile(imageFilePathName); imageContainer = binData.getData(); //table.Image = _Party.RecId; table.Image = imageContainer; table.insert(); } }
*This post is locked for comments
Create Container in A_ImageTable and Use Code to Save Image in Table.
I created an field with container, so I need to write this code in job right??
Does this code will make me to insert the image in the table..
Well, you can take help from CompanyImage Form
yes, i tried but i don't know how to insert image in table level itself..
Do you have form for inserting the Image or you want to insert directly to table ?
If you want to insert directly to table , you can use above job.
Ya i tried to use tat job..
But wat i need is i like to display the image in table level..
I just tried by adding a field File path and overrided active method in form datasource and used the coding as:
public int active()
{
int ret;
Image logoImage;
AX_BookMaster ax_bookmasterLocal;
container imageContainer;
BinData binData = new BinData();
;
ret = super();
select ax_bookmasterLocal where ax_bookmasterLocal.Book_Id == AX_TransactionLine.Book_Id;
if(ax_bookmasterLocal.FilePath)
binData.loadFile(ax_bookmasterLocal.FilePath);
imageContainer = binData.getData();
logoImage = new Image();
logoImage.setData(imageContainer);
bookimage.image(logoImage);
bookimage.widthValue(logoImage.width());
bookimage.heightValue(logoImage.height());
}
return ret;
But i like to insert the image in table level, so tat wen the record is inserted in form so that the image will display automatically..
Is there any way to do like tat?
I don't understand your business requirement, sorry. can you please elaborate it? Record are inserted through form level and if image is inserted through form level linked to specific record , so it will inserted into table itself and display to form as well. AX does this for company Image, for instance. what is the problem with company Image? please provide more details?
what if you want the image to show up on the report? this report gets data from the table? How do you then insert the image into the table? I've a field that is of type container with extended data type of bitmap. How do I insert an image into a table?
Thanks in advance for the help!
Check this link
https://srisunthorn.wordpress.com/2014/11/05/how-to-display-employee-image-in-ax-2009-report/
www.daxrunbase.com/.../image-resources-in-reports
I've done in form to show images for active records.
In table I added a string field and named as Filepath and stored the location of Images.
In form active method:
select ax_bookmasterLocal where ax_bookmasterLocal.Book_Id == AX_TransLine.Book_Id;
BookImage.image(logoImage);
BookImage.widthValue(logoImage.width());
BookImage.heightValue(logoImage.height());
It will show like this when we change the books in line, the image will change based on active record in line.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Community Member 4
Nayyar Siddiqi 2
NNaumenko 2