cancel
Showing results for 
Search instead for 
Did you mean: 

How to insert a picture

Former Member
0 Kudos

Hi,

I want to know how to insert a picture in item master data inventory. Means, if I click item A the screen appears a picture one. How to do it?

Thanks for your info.

Regards,

Agung

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member204969
Active Contributor
0 Kudos

You can connect an image to an item by using Item Master Data window Remarks tab. On the right bellow there is a camera icon, after clicking on it you can insert the image.

former_member209699
Contributor
0 Kudos

Hi

You can customize the Item master screen by using a picture box. In that use two buttons (Browse and display) as in Employee master form.

#region ShowFolderBrowser

public void ShowFolderBrowser()

{

OpenFileDialog MyTest = new OpenFileDialog();

Process[] MyProcs;

MyProcs = Process.GetProcessesByName("SAP Business One");

if (MyProcs.Length != 0)

{

for (int i = 0; i <= MyProcs.Length - 1; i++)

{

WindowWrapper MyWindow = new WindowWrapper(MyProcs<i>.MainWindowHandle);

//MyTest.Filter = "Excel files (.xls)|.xls|Document files (.doc)|.doc"

if (MyTest.ShowDialog(MyWindow) == DialogResult.OK)

{

if (oForm.Mode == SAPbouiCOM.BoFormMode.fm_OK_MODE | oForm.Mode == SAPbouiCOM.BoFormMode.fm_UPDATE_MODE)

{

oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE;

}

SAPbouiCOM.PictureBox oPict;

int CurrentPane = oForm.PaneLevel;

if (CurrentPane == 11)

{

//oPict = (SAPbouiCOM.PictureBox)oForm.Items.Item("fol11_pic").Specific;

//oPict.Picture = MyTest.FileName;

oEditText = (SAPbouiCOM.EditText)oForm.Items.Item("et_path").Specific;

oEditText.Value = MyTest.FileName;

}

else if (CurrentPane == 12)

{

//oPict = (SAPbouiCOM.PictureBox)oForm.Items.Item("fol12_pic").Specific;

//oPict.Picture = MyTest.FileName;

oEditText = (SAPbouiCOM.EditText)oForm.Items.Item("et_Path1").Specific;

oEditText.Value = MyTest.FileName;

}

System.Windows.Forms.Application.ExitThread();

}

else

{

System.Windows.Forms.Application.ExitThread();

}

}

}

else

{

Console.WriteLine("No SBO instances found.");

}

}

#endregion

#region BrowseFileDialog

public void BrowseFileDialog()

{

try

{

ShowFolderBrowserThread = new System.Threading.Thread(ShowFolderBrowser);

if (ShowFolderBrowserThread.ThreadState == System.Threading.ThreadState.Unstarted)

{

ShowFolderBrowserThread.SetApartmentState(ApartmentState.STA);

ShowFolderBrowserThread.Start();

}

//ShowFolderBrowserThread.Join()

else if (ShowFolderBrowserThread.ThreadState == System.Threading.ThreadState.Stopped)

{

ShowFolderBrowserThread.Start();

ShowFolderBrowserThread.Join();

}

}

catch (Exception ex)

{

//objMain.objApplication.StatusBar.SetText(ex.Message);

}

}

#endregion

public void DisplayFile()

{

string strFullPath = string.Empty;

//Dim oEditColPath As SAPbouiCOM.EditTextColumn

int CurrentPane = oForm.PaneLevel;

if (CurrentPane == 11)

{

oEditText = (SAPbouiCOM.EditText)oForm.Items.Item("et_path").Specific;

}

if (CurrentPane == 12)

{

oEditText = (SAPbouiCOM.EditText)oForm.Items.Item("et_Path1").Specific;

}

string strImgPath = oEditText.Value.ToString();

if (strImgPath != "")

{

openFile(strImgPath);

}

}

public void openFile(string strpath)

{

ProcessStartInfo X = new ProcessStartInfo();

X.UseShellExecute = true;

X.FileName = strpath;

Process.Start(X);

X = null;

}

Former Member
0 Kudos

Hi Friend,

In the Item Master Data - Remarks tab, if you click on the camera icon, you are permitted to select a .bmp or .jpg picture file for this item.

You can browse a certain existing picture in your system and save the changes to the item master data.

Hope this can help.

Kind Regards,

Dani Zhao

SAP Business One Forums Team