BOReader displaying blank column

Hello,

I keep getting a blank column in Job Manager using BO Reader.

Here is my code.

// **************************************************
// Custom code for JobManagerForm
// Created: 14/09/2018 14:02:13
// **************************************************
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;
using Ice.Proxy.Lib; // BOReader

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 **

	EpiUltraGrid myGrid;
	private BOReaderImpl _boReader; 

	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

		myGrid = (EpiUltraGrid)csm.GetNativeControlReference("f1959434-7042-4fd9-a610-4c6863adbdfe");
		myGrid.DisplayLayout.Bands[0].Columns.Add("BatchNo_c","BatchNo");
		myGrid.InitializeRow += new Infragistics.Win.UltraWinGrid.InitializeRowEventHandler(grdMatLst_InitializeRow);
		BOReaderImpl _boReader = WCFServiceSupport.CreateImpl<BOReaderImpl>((Ice.Core.Session)oTrans.Session, Epicor.ServiceModel.Channels.ImplBase<Ice.Contracts.BOReaderSvcContract>.UriPath);
	}

	private void grdMatLst_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
	{
		if(!String.IsNullOrEmpty(e.Row.Cells["BatchNo_c"].Value.ToString()))
		{
		DataSet ds = _boReader.GetRows("JobHead","BatchNo_c='" +e.Row.Cells["BatchNo_c"].Value.ToString()+ "'","BatchNo_c");
		if(ds.Tables[0].Rows.Count > 0 )
		e.Row.Cells["BatchNo_c"].Value = ds.Tables[0].Rows[0]["BatchNo_c"];
		}
	}
	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

		myGrid.InitializeRow += new Infragistics.Win.UltraWinGrid.InitializeRowEventHandler(grdMatLst_InitializeRow);
		_boReader = null;
	}
}




Thanks again.

You have a global _boReader variable, but then in Initialize you create a new local variable, so the global one never gets set perhaps.

This must be changed to

_boReader = WCFServiceSupport.CreateImpl<BOReaderImpl>((Ice.Core.Session)oTrans.Session, Epicor.ServiceModel.Channels.ImplBase<Ice.Contracts.BOReaderSvcContract>.UriPath)
1 Like

Also in DestroyCustomCode shouldn’t this be -=

1 Like

I’ll give it a go.

Hi Haso,

It’s giving me this error now.

Forgot the semi-colon but it’s still blank :frowning:

The next thing change “JobHead” to “Erp:BO:Job”

1 Like

All done but still coming back blank :smiley:

I’ve tired

changing GetList from GetRow made no difference because I thought it may struggle with UD columns.

I included JobNum because I thought it may look at that.

		if(!String.IsNullOrEmpty(e.Row.Cells["JobNum"].Value.ToString()))
		{
		DataSet ds = _boReader.GetList("Erp:BO:Job","JobNum='" +e.Row.Cells["JobNum"].Value.ToString()+ "'","BatchNo_c");

Current code:

// **************************************************
// Custom code for JobManagerForm
// Created: 14/09/2018 14:02:13
// **************************************************
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;
using Ice.Proxy.Lib; // BOReader
using Erp.BO;
using Ice.BO;

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 **

	EpiUltraGrid myGrid;
	private BOReaderImpl _boReader; 

	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

		myGrid = (EpiUltraGrid)csm.GetNativeControlReference("f1959434-7042-4fd9-a610-4c6863adbdfe");
		myGrid.DisplayLayout.Bands[0].Columns.Add("BatchNo_c","BatchNo");

		myGrid.InitializeRow += new Infragistics.Win.UltraWinGrid.InitializeRowEventHandler(grdMatLst_InitializeRow);
		_boReader = WCFServiceSupport.CreateImpl<BOReaderImpl>((Ice.Core.Session)oTrans.Session, Epicor.ServiceModel.Channels.ImplBase<Ice.Contracts.BOReaderSvcContract>.UriPath);
	}

	private void grdMatLst_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
	{
		if(!String.IsNullOrEmpty(e.Row.Cells["JobNum"].Value.ToString()))
		{
		DataSet ds = _boReader.GetList("Erp:BO:Job","JobNum='" +e.Row.Cells["JobNum"].Value.ToString()+ "'","BatchNo_c");

		if(ds.Tables[0].Rows.Count > 0 )
		e.Row.Cells["BatchNo_c"].Value = ds.Tables[0].Rows[0]["BatchNo_c"];
		}
	}

	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

		myGrid.InitializeRow -= new Infragistics.Win.UltraWinGrid.InitializeRowEventHandler(grdMatLst_InitializeRow);
		_boReader = null;
	}
}













Still god damn blank :angry:

Nah didn’t return anything. :confused:

Sorry I meant with Erp:BO:Job

DataSet ds = _boReader.GetRows("Erp:BO:Job","BatchNo_c='" +e.Row.Cells["BatchNo_c"].Value.ToString()+ "'", string.Empty);
1 Like

Nothing my man… I don’t know how many times I’ve sighed now :smiley:

It’s just returning blank anything I do.

Execute it through REST/Swagger and see what is returned.

Can you really filter using UD columns?
Can you try filtering using a base column?
Can you display other columns or everything is blank?

Hi Jonathan,

I can get the information through rest no problems whatsoever.

It’s still bugging me why the column isn’t displaying anything.

Kind regards,
Aaron.

My current code:

// **************************************************
// Custom code for JobManagerForm
// Created: 14/09/2018 14:02:13
// **************************************************


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;
using Ice.Proxy.Lib; // BOReader
using Ice.Core;
using Erp.BO;
using Ice.BO;



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 **
    	EpiUltraGrid myGrid;
    	BOReaderImpl _boReader;

    	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
    		myGrid = (EpiUltraGrid)csm.GetNativeControlReference("f1959434-7042-4fd9-a610-4c6863adbdfe");
    		myGrid.DisplayLayout.Bands[0].Columns.Add("BatchNo_c","BatchNo");
    		myGrid.InitializeRow += new Infragistics.Win.UltraWinGrid.InitializeRowEventHandler(grdMatLst_InitializeRow);
    		_boReader = WCFServiceSupport.CreateImpl<BOReaderImpl>((Ice.Core.Session)oTrans.Session, Epicor.ServiceModel.Channels.ImplBase<Ice.Contracts.BOReaderSvcContract>.UriPath);
    	}
    	private void grdMatLst_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
    	{
    		if(!String.IsNullOrEmpty(e.Row.Cells["JobNum"].Value.ToString()))
    		{
    			DataSet ds = _boReader.GetRows("Erp:BO:Job","JobNum = '" + e.Row.Cells["JobNum"].Value.ToString() + "'","JobNum, BatchNo_c");
    			if(ds.Tables[0].Rows.Count > 0 ) 
    			{
    				e.Row.Cells["BatchNo_c"].Value = ds.Tables[0].Rows[0]["BatchNo_c"].ToString();
    			}
    		}
    	}
    	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
    		myGrid.InitializeRow -= new Infragistics.Win.UltraWinGrid.InitializeRowEventHandler(grdMatLst_InitializeRow);
    		_boReader = null;
    	}
    }







Anyone able to help me get BatchNo_c displaying from JobHead?

1 Like

Got it, I needed Erp:BO:JobEntry not Erp:BO:Job

Thanks again.

Hi @aarong ,

I am getting below mentioned error while running above code

Compiling Custom Code …

----------errors and warnings------------

Error: CS0308 - line 41 (239) - The non-generic type ‘Epicor.ServiceModel.Channels.ImplBase’ cannot be used with type arguments

** Compile Failed. **

Could you please suggest how to resolve this issue. This issue is coming due to below line
_boReader = WCFServiceSupport.CreateImpl((Ice.Core.Session)oTrans.Session, Epicor.ServiceModel.Channels.ImplBase<Ice.Contracts.BOReaderSvcContract>.UriPath);

Try

_boReader = WCFServiceSupport.CreateImpl<BOReaderImpl>((Ice.Core.Session)oTrans.Session, Ice.Proxy.Lib.BOReaderImpl.UriPath);

What version are you on? 10.2.100.9