When using the dashboard we find the first two have no issues but the “GOLD Documents” throws an error after clicking the “download” control.
We initially tried the browser within a customization but found that it created a memory leak. I’ve also noticed that the “download” control actually functions as intended displaying the ability to ‘Open’ or ‘Save’ the item. Preferred is the customization route but open to using the dashboard if we can get past the errors.
// **************************************************
// Custom code for PartAdvisorForm
// Created: 3/2/2022 10:15:38 AM
// **************************************************
extern alias Erp_Contracts_BO_PartAdvisor;
extern alias Erp_Contracts_BO_Part;
extern alias Ice_Core_Session;
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Erp.Adapters;
using Erp.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;
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 System.Windows.Forms.WebBrowser wbSite;
private EpiDataView edvPartView;
private System.Windows.Forms.WebBrowser wbSite2;
private EpiDataView edvPartView2;
private System.Windows.Forms.WebBrowser wbSite3;
private EpiDataView edvPartView3;
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
this.edvPartView = ((EpiDataView)(this.oTrans.EpiDataViews["PartView"]));
this.edvPartView.EpiViewNotification += new EpiViewNotification(this.edvPartView_EpiViewNotification);
this.edvPartView2 = ((EpiDataView)(this.oTrans.EpiDataViews["PartView"]));
this.edvPartView2.EpiViewNotification += new EpiViewNotification(this.edvPartView_EpiViewNotification);
this.edvPartView3 = ((EpiDataView)(this.oTrans.EpiDataViews["PartView"]));
this.edvPartView3.EpiViewNotification += new EpiViewNotification(this.edvPartView_EpiViewNotification);
}
public void SetupBrowser(string partNum)
{
grpBrws.Controls.Remove(wbSite);
grpBrws.Dock = System.Windows.Forms.DockStyle.Fill;
wbSite = new System.Windows.Forms.WebBrowser();
wbSite.Dock = System.Windows.Forms.DockStyle.Fill;
wbSite.Location = new System.Drawing.Point(0,0);
wbSite.MinimumSize = new System.Drawing.Size(20,20);
wbSite.Name = "wbSite";
wbSite.Size = new System.Drawing.Size(560,323);
wbSite.TabIndex = 0;
wbSite.ScriptErrorsSuppressed = true;
grpBrws.Controls.Add(wbSite);
wbSite.Navigate("http://gold/ExternalPages/External_DocumentExplorer.aspx?Part=" + partNum);
}
public void SetupBrowser2(string partNum)
{
grpBrws2.Controls.Remove(wbSite2);
grpBrws2.Dock = System.Windows.Forms.DockStyle.Fill;
wbSite2 = new System.Windows.Forms.WebBrowser();
wbSite2.Dock = System.Windows.Forms.DockStyle.Fill;
wbSite2.Location = new System.Drawing.Point(0,0);
wbSite2.MinimumSize = new System.Drawing.Size(20,20);
wbSite2.Name = "wbSite2";
wbSite2.Size = new System.Drawing.Size(560,323);
wbSite2.TabIndex = 0;
wbSite2.ScriptErrorsSuppressed = true;
grpBrws2.Controls.Add(wbSite2);
Ice.Core.Session ss=(Ice.Core.Session)PartAdvisorForm.Session;
string user = ss.EmployeeID;
wbSite2.Navigate("http://gold/ExternalPages/External_DocumentUploader.aspx?Part=" + partNum + "&UserID=" + user);
}
public void SetupBrowser3(string partNum)
{
grpBrws3.Controls.Remove(wbSite3);
grpBrws3.Dock = System.Windows.Forms.DockStyle.Fill;
wbSite3 = new System.Windows.Forms.WebBrowser();
wbSite3.Dock = System.Windows.Forms.DockStyle.Fill;
wbSite3.Location = new System.Drawing.Point(0,0);
wbSite3.MinimumSize = new System.Drawing.Size(20,20);
wbSite3.Name = "wbSite3";
wbSite3.Size = new System.Drawing.Size(560,323);
wbSite3.TabIndex = 0;
wbSite3.ScriptErrorsSuppressed = true;
grpBrws3.Controls.Add(wbSite3);
Ice.Core.Session ss=(Ice.Core.Session)PartAdvisorForm.Session;
string user = ss.EmployeeID;
wbSite3.Navigate("http://gold/ExternalPages/External_ChangeRequest.aspx?Part=" + partNum + "&UserID=" + user);
}
private void edvPartView_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
{
// ** Argument Properties and Uses **
// view.dataView[args.Row]["FieldName"]
// args.Row, args.Column, args.Sender, args.NotifyType
// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
if ((args.NotifyType == EpiTransaction.NotifyType.Initialize))
{
if ((args.Row > -1))
{
string partNum = view.dataView[view.Row]["PartNum"].ToString();
SetupBrowser(partNum);
SetupBrowser2(partNum);
SetupBrowser3(partNum);
}
}
}
public void DestroyCustomCode()
{
// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
// Begin Wizard Added Object Disposal
// End Wizard Added Object Disposal
// Begin Custom Code Disposal
// End Custom Code Disposal
}
}



