So, I successfully added an option to ‘Open with’ when I right click on JobHead_JobNum. The problem is that I now want to hide the original ‘Open with Job Entry’ which is still there. How can I hide it?
I can’t delete the option because I get this error:
I have this code:
private void MainController_Load(object sender, EventArgs args)
{
// Add Event Handler Code
// Add custom Job Entry when right clicking on a job number
oTrans.RegisterContextHandler("V_Q_ProjectTrackerJobs_1View1.JobHead_JobNum", "Job Entry", new EpiTransaction.ContextClicked(OpenJob));
}
private object OpenJob(object sender, object currentValue)
{
using (oTrans.PushDisposableStatusText(EpiString.GetString("retrievingData"), true))
{
try
{
EpiDataView viewJobs = ((EpiDataView)(this.oTrans.EpiDataViews["V_Q_ProjectTrackerJobs_1View1"]));
string jobID = viewJobs.dataView[viewJobs.Row]["JobHead_JobNum"].ToString();
string plantID = viewJobs.dataView[viewJobs.Row]["Plant_Plant"].ToString();
NameValueCollection options = new NameValueCollection()
{
{ "JobNumber", jobID },
{ "Request", "OpenJob"},
};
LaunchFormOptions lfo = new LaunchFormOptions();
lfo.ContextValue = options;
//get session
Ice.Core.Session ss=(Ice.Core.Session)MainController.Session;
string originalSiteID = ss.PlantID; //get site
ss.PlantID = plantID;
ProcessCaller.LaunchForm(oTrans, "PJGO1010", lfo); //open job entry form
ss.PlantID = originalSiteID; //set back to original site
}
catch (Exception ex)
{
ExceptionBox.Show(ex);
}
}
return "";
}