Refresh Doesn't Work on UD Tables

In your case you are trying to refresh the existing data set right? If so you can't instanciate your own adapter or the data won't refresh properly, you have to grab a hold of the current adapter as shown. DO NOT! Dispose of that adapter.... or you'll break your screen

UD08Adapter oTrans_adapter;
this.oTrans_adapter = ((UD08Adapter)(this.csm.TransAdaptersHT["oTrans_adapter"]));
EpiDataView edv = oTrans.Factory("UD08");
oTrans_adapter.GetByID(edv.dataView[edv.Row]["Key1"].ToString(),edv.dataView[edv.Row]["Key2"].ToString(),edv.dataView[edv.Row]["Key3"].ToString(),edv.dataView[edv.Row]["Key4"].ToString(),edv.dataView[edv.Row]["Key5"].ToString());
oTrans.NotifyAll();


Jose C Gomez
Software Engineer


T: 904.469.1524 mobile

Quis custodiet ipsos custodes?

On Tue, Oct 13, 2015 at 9:39 AM, Rob Bucek rbucek@... [vantage] <vantage@yahoogroups.com> wrote:

Â
<div>
  
  
  <p>Ok, by no means am I an expert here, but this is what I usually do in this instance


Make sure you bring in your assembly references for UD08 (I usually bring in the contracts & the adapter cuz it really doesn’t hurt)

In your public class script (I do this here so I only have to do it once for the entire customization)
private EpiDataView edvUD08;
private EpiBaseAdapter oTrans_adapter;

In your InitializeCustomCode()
this.edvUD08 = ((EpiDataView)(this.oTrans.EpiDataViews["UD08"]));

In your Event

Ice.Adapters.UD08Adapter ud08Adapter = new Ice.Adapters.UD08Adapter(UD08Form);
Ud08Adapter.BOConnect();
string Key1 = edvUD08.dataView[edvUD08.Row]["Key1"].ToString();
bool MyUD = ud28Adapter.GetByID(Key1, "", "", "", "");

hope this helps

Rob Bucek
Production Control Manager
D&S Manufacturing
301 E. Main St. | PO Box 279
Black River Falls, WI 54615
715-284-5376 Ext. 311
Mobile: 715-896-3119
rbucek@...
www.dsmfg.com<http://www.dsmfg.com>

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Tuesday, October 13, 2015 7:54 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Refresh Doesn't Work on UD Tables




Am i over complicating this? here's what i have in C# right now. I get to Message 4 and then get an unhandled exception error: Object reference not set to an instance of an object.


private void baseToolbarsManager_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs args)
{
MessageBox.Show("GotHere0");
if(args.Tool.Key.ToString() == "RefreshTool") // Action will only run when refresh button is clicked
{
MessageBox.Show("GotHere1");
EpiDataView edvUD08 = ((EpiDataView)(oTrans.EpiDataViews["UD08"]));
string key1 = (edvUD08.dataView[edvUD08.Row]["Key1"]).ToString(); //Find Key 1 Field and set to key1 var
MessageBox.Show("GotHere2");
UD08Adapter myUDAdapter = new UD08Adapter(((Session)oTrans.Session).ConnectionPool);
MessageBox.Show("GotHere3");
myUDAdapter.BOConnect();
MessageBox.Show("GotHere4");
bool myUD = myUDAdapter.GetByID(key1,"","","","");
MessageBox.Show("GotHere5");
myUDAdapter.Dispose();
MessageBox.Show("GotHere6");
}

}
}



[Non-text portions of this message have been removed]

</div>
 


<div style="color:rgb(255,255,255);min-height:0px;"></div>

So I'm using some UD tables and the Refresh button doesn't work. I've called Epicor and they said it's still a problem in 10 so they don't anticipate a fix anytime soon. Anyone else run into this? If so what did you do to fix? 


Thanks, 

Bobby

Anyone have any ideas or suggestions on how to make this work in C#? 

Thanks 
Bobby
You can just re-run a get by id on the adapter.


Jose C Gomez
Software Engineer


T: 904.469.1524 mobile

Quis custodiet ipsos custodes?

On Mon, Oct 12, 2015 at 8:37 AM, ralmon@... [vantage] <vantage@yahoogroups.com> wrote:

Â
<div>
  
  
  <p>Anyone have any ideas or suggestions on how to make this work in C#? </p><div><br></div><div>Thanks </div><div>Bobby</div><p></p>

</div><span class="ygrps-yiv-849689384">
 


<div style="color:#fff;min-height:0;"></div>


Am i over complicating this? here's what i have in C# right now. I get to Message 4 and then get an unhandled exception error: Object reference not set to an instance of an object. 

private void baseToolbarsManager_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs args)
{
MessageBox.Show("GotHere0");
if(args.Tool.Key.ToString() == "RefreshTool") // Action will only run when refresh button is clicked 
{
MessageBox.Show("GotHere1");
EpiDataView edvUD08 = ((EpiDataView)(oTrans.EpiDataViews["UD08"]));
string key1 = (edvUD08.dataView[edvUD08.Row]["Key1"]).ToString(); //Find Key 1 Field and set to key1 var
MessageBox.Show("GotHere2");
UD08Adapter myUDAdapter = new UD08Adapter(((Session)oTrans.Session).ConnectionPool);
MessageBox.Show("GotHere3");
myUDAdapter.BOConnect();
MessageBox.Show("GotHere4");
bool myUD = myUDAdapter.GetByID(key1,"","","","");
MessageBox.Show("GotHere5");
myUDAdapter.Dispose();
MessageBox.Show("GotHere6");
}

}
}

Not sure if this helps any, but I usually find when I get the error: Object reference not set to an instance of an object, that the data I’m using has a null field or something else missing. It could be your code is ok, but your data is not good.

 

Just a thought.

 

Thanks,

 

Steve

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Tuesday, October 13, 2015 8:54 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Refresh Doesn't Work on UD Tables

 

 

Am i over complicating this? here's what i have in C# right now. I get to Message 4 and then get an unhandled exception error: Object reference not set to an instance of an object. 

 

            private void baseToolbarsManager_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs args)

            {

                        MessageBox.Show("GotHere0");

                        if(args.Tool.Key.ToString() == "RefreshTool") // Action will only run when refresh button is clicked 

                        {

                                    MessageBox.Show("GotHere1");

                                    EpiDataView edvUD08 = ((EpiDataView)(oTrans.EpiDataViews["UD08"]));

                                    string key1 = (edvUD08.dataView[edvUD08.Row]["Key1"]).ToString(); //Find Key 1 Field and set to key1 var

                                    MessageBox.Show("GotHere2");

                                    UD08Adapter myUDAdapter = new UD08Adapter(((Session)oTrans.Session).ConnectionPool);

                                    MessageBox.Show("GotHere3");

                                    myUDAdapter.BOConnect();

                                    MessageBox.Show("GotHere4");

                                    bool myUD = myUDAdapter.GetByID(key1,"","","","");

                                    MessageBox.Show("GotHere5");

                                    myUDAdapter.Dispose();

                                    MessageBox.Show("GotHere6");

                        }

 

            }

}

 

Ok, by no means am I an expert here, but this is what I usually do in this instance

Make sure you bring in your assembly references for UD08 (I usually bring in the contracts & the adapter cuz it really doesn’t hurt)

In your public class script (I do this here so I only have to do it once for the entire customization)
private EpiDataView edvUD08;
private EpiBaseAdapter oTrans_adapter;

In your InitializeCustomCode()
this.edvUD08 = ((EpiDataView)(this.oTrans.EpiDataViews["UD08"]));

In your Event

Ice.Adapters.UD08Adapter ud08Adapter = new Ice.Adapters.UD08Adapter(UD08Form);
Ud08Adapter.BOConnect();
string Key1 = edvUD08.dataView[edvUD08.Row]["Key1"].ToString();
bool MyUD = ud28Adapter.GetByID(Key1, "", "", "", "");

hope this helps

Rob Bucek
Production Control Manager
D&S Manufacturing
301 E. Main St. | PO Box 279
Black River Falls, WI 54615
715-284-5376 Ext. 311
Mobile: 715-896-3119
rbucek@...
www.dsmfg.com<http://www.dsmfg.com>

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Tuesday, October 13, 2015 7:54 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Refresh Doesn't Work on UD Tables



Am i over complicating this? here's what i have in C# right now. I get to Message 4 and then get an unhandled exception error: Object reference not set to an instance of an object.

private void baseToolbarsManager_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs args)
{
MessageBox.Show("GotHere0");
if(args.Tool.Key.ToString() == "RefreshTool") // Action will only run when refresh button is clicked
{
MessageBox.Show("GotHere1");
EpiDataView edvUD08 = ((EpiDataView)(oTrans.EpiDataViews["UD08"]));
string key1 = (edvUD08.dataView[edvUD08.Row]["Key1"]).ToString(); //Find Key 1 Field and set to key1 var
MessageBox.Show("GotHere2");
UD08Adapter myUDAdapter = new UD08Adapter(((Session)oTrans.Session).ConnectionPool);
MessageBox.Show("GotHere3");
myUDAdapter.BOConnect();
MessageBox.Show("GotHere4");
bool myUD = myUDAdapter.GetByID(key1,"","","","");
MessageBox.Show("GotHere5");
myUDAdapter.Dispose();
MessageBox.Show("GotHere6");
}

}
}




[Non-text portions of this message have been removed]