Add a article picture?
martinsalo
Hello Forum,
how can I add a picture to the article dialog? Normally I can click on the Camera in the Description Tab and then the picture is filled in a picturebox with ID:78. And after saving, the pictures are saved in the table OITM. But how can I do that by code?
As far as I understand it right, its forbidden to write the picture name directly into the database by a SQL Update Stmnt.
Thanks
Martin.
Sebastian Hagen
Hey Martin,
try to put image files named with item code and .jpg ending into your images folder, defined in general settings - path tab.
It worked fine with the sample pictures in the SBODemo database.
Greetings!
Sebastian
martinsalo
The ItemCode as picture name is suggested to avoid files-overalp?
I'm trying to add the picture, but it doesnt work. I have looked into the OITM table and found an entry with "images.jpg" as PicturName. I have found the article in the ArticleBasicData and the picture is shown correctly in the description tab. If I debug the ArticleBasicData Form, I can see that the picturebox is bound to OITM->PicturName regardless if an article with or without picture is shown. And if an article with picture is loaded into the ArticleBasicDataForm, the Value und the Picture Property is set for example to "IMAGES.JPG". The source that doenst work:
TabDescription.Select();
SwissAddonFramework.UI.Components.PictureBox picArticlePicture = SwissAddonFramework.UI.Components.PictureBox.GetFromUID(FormArticleBasicData, "78");
picArticlePicture.Value = "IMAGES.JPG";
picArticlePicture.Picture = "IMAGES.JPG";
picArticlePicture.Update();
Edit: The picture can be loaded to the form, if the form is in find modus. But nothing happens if the form is already in Add or Update modus. If I load the picture in the find modus and switch to update oder add modus, the picture disappears from the form.
Please sign in to leave a comment.
Comments
0 comments