troubleshooting Question

C# Pull value from screen

Avatar of Trygve Thayer
Trygve ThayerFlag for United States of America asked on
VB ScriptC#
4 Comments1 Solution435 ViewsLast Modified:
We are using Epicor customization tools and need some help with passing a variable.  We know how to do it in VB but not C#   In the example below we are working on the private void epiButtonC1_Click(object sender, System.EventArgs args) event and will copycat to the other button click events once we find a solution.  There is a box on the screen where we are trying to get the information from it using the GUID and then pass it to the form we are opening.  The MessageBox in there is to check and see if the value shows up but that is not right either as it just shows "MyJob"


// **************************************************
// Custom code for MainController
// Created: 05/09/2018 2:44:06 PM
// **************************************************
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Epicor.Mfg.BO;
using Epicor.Mfg.UI;
using Epicor.Mfg.UI.Adapters;
using Epicor.Mfg.UI.Customization;
using Epicor.Mfg.UI.ExtendedProps;
using Epicor.Mfg.UI.FormFunctions;
using Epicor.Mfg.UI.FrameWork;
using Epicor.Mfg.UI.Searches;

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 **
	private EpiTextBox MyJob;

	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.epiButtonC1.Click += new System.EventHandler(this.epiButtonC1_Click);
		this.epiButtonC2.Click += new System.EventHandler(this.epiButtonC2_Click);
		this.epiButtonC3.Click += new System.EventHandler(this.epiButtonC3_Click);
		this.epiButtonC4.Click += new System.EventHandler(this.epiButtonC4_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.epiButtonC1.Click -= new System.EventHandler(this.epiButtonC1_Click);
		this.epiButtonC2.Click -= new System.EventHandler(this.epiButtonC2_Click);
		this.epiButtonC3.Click -= new System.EventHandler(this.epiButtonC3_Click);
		this.epiButtonC4.Click -= new System.EventHandler(this.epiButtonC4_Click);
		// End Wizard Added Object Disposal

		// Begin Custom Code Disposal

		// End Custom Code Disposal
	}

	private void epiButtonC1_Click(object sender, System.EventArgs args)
	{
		// ** Place Event Handling Code Here **
		MyJob = (EpiTextBox)csm.GetNativeControlReference("a214bbab-19c0-4575-8387-591adb7c0624");
		LaunchFormOptions lfo = new LaunchFormOptions();
		lfo.ContextValue = MyJob;
		lfo.IsModal = false;
		lfo.SuppressFormSearch = true;
		MessageBox.Show ("MyJob");
		ProcessCaller.LaunchForm (oTrans, "IMGO3005", lfo);		
	}

	private void epiButtonC2_Click(object sender, System.EventArgs args)
	{
		// ** Place Event Handling Code Here **
		LaunchFormOptions lfo = new LaunchFormOptions();
		lfo.ContextValue = "MyJob";
		lfo.IsModal = false;
		lfo.SuppressFormSearch = true;
		ProcessCaller.LaunchForm (oTrans, "IMGO3001", lfo);
	}

	private void epiButtonC3_Click(object sender, System.EventArgs args)
	{
		// ** Place Event Handling Code Here **
		LaunchFormOptions lfo = new LaunchFormOptions();
		lfo.ContextValue = "MyJob";
		lfo.IsModal = false;
		lfo.SuppressFormSearch = true;
		ProcessCaller.LaunchForm (oTrans, "JCGO3002", lfo);
	}

	private void epiButtonC4_Click(object sender, System.EventArgs args)
	{
		// ** Place Event Handling Code Here **
		LaunchFormOptions lfo = new LaunchFormOptions();
		lfo.ContextValue = "MyJob";
		lfo.IsModal = false;
		lfo.SuppressFormSearch = true;
		ProcessCaller.LaunchForm (oTrans, "IMGO3014", lfo);
	}
}
ASKER CERTIFIED SOLUTION
Trygve Thayer
IT Director

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros