Just seeking a little bit of assistance on the following subject as my C# skills are very limited.
Basically, what I am trying to achieve is the browse file functionality then to paste the selected file path into the stock model file path field . (Field name = JobMtl.StockModel_c) / EpicTextBox1.
I am able to retrieve the file path however getting it back in to Epicor seems to be my problem .
The tracker at the bottom of the screen is filtered by a published column from the main body.
You’re almost there. So you returned your file path string from your open file dialog but now you want to place that string into a field within one of your panels, correct?
First, find the name of your panel within the Tree View of the customization dialog.
To set the value of that epidataview field, you will want to know the column name from the BAQ that corresponds to that field. In this example, my dataview column is bound to the Part.ShortChar01 field from my BAQ.
Off the back off this I was trying to achieve pulling the file path from the stock model field to display the image in the screenshot box, however I have had a go at it but with no luck so far. Hopefully someone might be able to point me in the right direction ?
// **************************************************
// Custom code for MainController
// Created: 12/02/2018 12:11:10
// **************************************************
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Ice.BO;
using Ice.UI;
using Ice.Lib;
using Ice.Adapters;
using Ice.Lib.Customization;
using Ice.Lib.ExtendedProps;
using Ice.Lib.Framework;
using Ice.Lib.Searches;
using Ice.UI.FormFunctions;
using System.Drawing;
using System;
using System.Collections.Generic;
using System.Text;
using System.Resources;
public class Script
{
// ** Wizard Insert Location - Do Not Remove ‘Begin/End Wizard Added Module Level Variables’ Comments! **
// Begin Wizard Added Module Level Variables **
// End Wizard Added Module Level Variables **
// Add Custom Module Level Variables Here **
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
this.btnSet.Click += new System.EventHandler(this.btnSet_Click);
// End Wizard Added Custom Method Calls
}
public void DestroyCustomCode()
{
// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
// Begin Wizard Added Object Disposal
this.btnSet.Click -= new System.EventHandler(this.btnSet_Click);}
// End Wizard Added Object Disposal
// Begin Custom Code Disposal
// End Custom Code Disposal
private void btnSet_Click(object sender, System.EventArgs args)
{
// ** Place Event Handling Code Here **
{
EpiDataView edvMTL = ((EpiDataView)(this.oTrans.EpiDataViews["V_JobMtlReviewApproval_1View"]));
string filename = ((edvMTL.dataView[edvMTL.Row]["JobMtl_StockModel_c"].ToString()));
MessageBox.Show(filename);
picImage.Image = Image.FromFile(filename);
This was the error I got:
at System.Drawing.Image.FromFile(String filename, Boolean useEmbeddedColorManagement)
at Script.btnSet_Click(Object sender, EventArgs args)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at Infragistics.Win.Misc.UltraButtonBase.OnClick(EventArgs e)
at Ice.Lib.Framework.EpiButton.OnClick(EventArgs e)
at Infragistics.Win.Misc.UltraButton.OnMouseUp(MouseEventArgs e)
at Ice.Lib.Framework.EpiButton.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)