Need Guidance for customization

Hi,
I am using classic version. In a customization, I would like to recreate the similar pattern/section of - Part Image-File(search Option) to import the image. Please help me.
can someone guide me with steps or KB article to do recreate this Part Image section?


I am familiar with the basic customizations but I do not know how to bring the Image search screen to appear to import the image from the system and the image to get displayed.

Thanks
Subha

1 Like

If no one steps up, I’ll throw you a bone later.
Gotta run for now.

oh thank you Kevin!! :slightly_smiling_face:

Looking at the form:

  • The image itself displayed on a EpiPictureBox contol, which is tied to Part.PhotoFile.
  • The textbox is just a normal EpiTextBox tied to Part.ImageID
  • The button is a normal EpiButton, apparently bound to Part.FileButton.

Nice thing is that all of these controls are available in the Customization Toolbox (as opposed to something like the EpiListPickerPanel, which has to be initialized in code). If you’re just trying to add the Part photo controls to a different form, you can just add them with the toolbox and bind them to the Part fields listed.

Note that I found all of this by just opening the form, hitting customize, and looking at the properties of each control.

1 Like

Here is some information on the image adapter:

John, I already tried this option. It did not work. After creating the File button through the Customization Toolbox and bound to Part.FileButton, when I click it, the “Image Search” is not opening.
It acts like a idle button.

Thanks Kevin, let me go through this video and see.

Not surprised. Turn on tracing and see what methods the stock button calls. Add them to your button_click event.

When I did the tracing below is the method I am seeing,

John,
Thank you so much!! the file button is working now, its taking me to the “Image search screen” but when I choose an image and click ok, the it is not displaying the part image. The screenshot is attached below

Neat.

Note that if you’re moving whole groups of controls from one page to another, you can also literally just move them with a couple of lines in InitializeCustomCode(). The group box will pull the child controls along.

Here’s an example where I consolidated the lot generation and attribute tabs into one. I also disabled visibility on the now-empty subtabs.

public void InitializeCustomCode()
	{
		// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
		// Begin Wizard Added Variable Initialization

		// End Wizard Added Variable Initialization

		// Begin Wizard Added Custom Method Calls

		// End Wizard Added Custom Method Calls

		//First grab the form objects by their guid.
		var partLotPanel1 = csm.GetNativeControlReference("6573e68f-b77c-411f-b1e0-5d28e77f6ef2");
		var grpGenerate = csm.GetNativeControlReference("824103df-e984-4eb9-843b-ad7fa572320f");
		var grpDeferLotAtt = csm.GetNativeControlReference("8a18042d-7aa8-4493-89ff-a5dabaddf40f");
		var grpPartLotAttrs = csm.GetNativeControlReference("3473b173-94c7-46b7-9751-ae36d4e8c2d7");
		//Then assign the parent to the new panel.
		grpGenerate.Parent = partLotPanel1;
		grpDeferLotAtt.Parent = partLotPanel1;
		grpPartLotAttrs.Parent = partLotPanel1;
	}

Save customization. Close out of the form and then reopen it. You can then move the controls normally on their new home.

Note that, because you’re altering stock items, there’s a small chance system updates might break this. However, the Classic forms are basically EOL, so I don’t think that’s much of a worry anymore.

1 Like

Thanks John, let me try this way.