Hello,
Does anyone know how to get the image resources id in order to display icon in a form in axapta 4.0 or axapta 2009?
Thank you
Hello,
Does anyone know how to get the image resources id in order to display icon in a form in axapta 4.0 or axapta 2009?
Thank you
Hi all,
I too need the same … Can any one have idea on it… please share…
Regards,
Zahir
Hi rinoa,
uploading image files for re-use
You want to implement functionality in Dynamics AX to store images (.jpg, .bmp, … files) which can be re-used for f.e. printing purposes on commercial documents such as the invoice or the packing slip. The end-user must be able to upload in an easy way such a file stored on his local disk, or to view and change the image.
Solution: re-use the Company logo code
Such functionality exists in standard Dynamics AX to store a Company logo for each Company Account (Basic>Setup>Company information>Company logo button). The great news is the code can be easily reused on whatever other form, since the table CompanyImage for storage of the images is generic as it contains the TableId and RecId of the record to which you link the image.
In the next example I’ll attach a logo to my CustTable records: so for each customer I would like to store a logo.
Open the Application Object Tree (AOT) and browse to Menu Items>Display>CompanyImage.
Open another AOT window and browse to your Customers form (Forms>CustTable).
Open the Design>Design>ButtonGroup node of the CustTable form.
Drag the CompanyImage menu item in the ButtonGroup.
Right-click the just added MenuItemButton and choose Properties. Add Customer Logo as Text property.
Save your changes.
When you open the Customers form now, a new button will be available Customer Logo. Click on it and you’ll be able to attach an image file to the active customer record. No further coding needed for storing, changing, viewing the image!
Your records will be saved in the CompanyImage table with as RefTableId the TableId (77) of the CustTable and the RefRecId of the Customer record selected upon attaching the image file.
To use these images in f.e. a report, add a Bitmap control to the report Design.
Add a display method for this added Bitmap control which looks for example as underneath (I work further on the example where I added images to my CustTable records). In my example I suppose there is a datasource for CustInvoiceJour.
display Bitmap showCustomerLogo()
{
CustTable custTable = CustTable::find(
custInvoiceJour.InvoiceAccount);
;
return CompanyImage::find(custTable.dataAreaId,
custTable.TableId, custTable.RecId).Image;
}
this is the code to create a new image in a table…
Hi,
To view the available resources, open the Microsoft Dynamics AX menu, click Tools, click Development tools, and then click Embedded resources. TheEmbedded resources window opens. The window displays the available images, and the Resource ID of each image.
For more help refer this link: http://msdn.microsoft.com/en-us/library/cc621437(v=ax.50).aspx
Hope this will help you.
Cheeers !!!
Hi Sravya,
Thank u for ur suggession.
I’m speaking about Ax2009 Report development.
For example: i’m checking with “tutorial_resources” report in Ax 2009, and i’m trying to figuring out the resource id and need to know how it is fetching that resource id and displaying it’s corresponding bitmap image.
Hi Zahir,
try this
SysResource::getResourceNodeData(SysResource::getResourceNode(‘Resousename’));
Regards,
Phani.
Hi,
in AOT, you go to macros node, find ResAppl and Resource macros, if you open them, you’ll see things like #define.ImageArrowUp(3134), this exemple displays an arrow up, you just have to find the image you want, names are quite explicits. Then in your form you declare
an imageRes variable, ex : imageRes imageResOK = aduImageListAppl_checkBox.image(#Image_OK); => case shows the green check,
then you uses imagesResOK to have the green check icon
mail me if not clear for you
regards,
Thomas
Hi Thomas,
My mailId : mailtozahir@gmail.com
Can u just send me sample code based on that…? I will verify and let you know for the same.
Regards,
Zahir
in form class declaration:
ImageListAppl_checkbox ImageListAppl_checkbox;
in form init() method:
ImageListAppl_checkbox = new ImageListAppl_checkbox(); //create new instance of class
in fillTree() form method:
imageRes imageResOK = ImageListAppl_checkBox.image(#Image_OK);//declaration #image_OK = a green check
I use the image in a treeview that I fill as following:
salesLineIdx = SysFormTreeControl::addTreeItem(blablabla some parms, wmsordertrans.expeditionStatus == wmsexpeditionstatus::Staged ? ImageResOK : ImageResNotOK);
depending on expedition status I set a green check or a red cross(imageResNotOK)
regards,
Thomas