In this example, we display the image of the item in the “List of Items” window. This window is used in all SAP modules where an item search is available.
When we select a line clicking in the first, Item no. description or In Stock columns, the image appears.
Item placement tool
Fist, we need to increase the size of this window using the Form Width and Height and add a field type Picture, no need to try adding a UDF, B1 Usability can create this type of objects that don’t store any information in the database.
The size of the window and the picture are only suggestions, you can increase or decrease these values.
B1 Validation system
The next step is to create a B1 Validation configuration, this module allows us to know when a row is clicked and in a specific column, here some columns are selected, the default ones displayed by SAP but more can be added.
If a column is not included in this module, for example, OnHand, if the user selects a row clicking in that column, the picture will not be displayed.
Universal function
Now, we add an action to the B1 Validation System, we do this with a universal Function type macro. This macro sets a value to the new picture field, in this case, the path with the name of the picture that corresponds to the selected item.
Macro:
Set($[$BOYX_1.0.0]|SQL:SELECT 'C:\Program Files (x86)\SAP\SAP Business One\Bitmaps\'+T0.[PicturName]FROM OITM T0 WHERE T0.[ItemCode] = $[$7.ItemCode.0.SELECTED]);
For this example, the path is C:\Program Files (x86)\SAP\SAP Business One\Bitmaps\ but this needs to be replaced with your own path, it should be a shared location so all the users have access to the images.
Also, we use the image selected in the item master data in the Remarks tab, the field is called PictureName, but other image fields can be used as well. For example, there is no need to attach or add the image in SAP, we can set the location of the images and name them like the item code, the system will find and display the picture as well.
Comments
0 comments
Please sign in to leave a comment.