905.700B External C# Application

No problem

-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of John Kreger
Sent: 10 July 2013 15:22
To: vantage@yahoogroups.com
Subject: Re: [Vantage] 905.700B External C# Application

Stephen,
Wow thanks. I, like an idiot, added a ds.ShipDtl.Rows[0].SetField("RowMod",
"U") instead of adding it on the ShipHead like it actually needed. Thanks for pointing it out.

Good to go!

John


On Wed, Jul 10, 2013 at 7:48 AM, Stephen Edginton
<stephene@...>wrote:

> **
>
>
> Hi John,
>
> You need to do something like this before the call
> ds.ShipHead.Rows[0].RowMod = "U"; this will ensure the BO method has
> the temp table for shiphead available to it.
> Really it is a bug in the progress logic.
>
> Hope it helps
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On
> Behalf Of John Kreger
> Sent: 09 July 2013 22:58
> To: vantage@yahoogroups.com
> Subject: [Vantage] 905.700B External C# Application
>
>
> We've created an external application to make our traceability process
> a bit smoother. I've fully integrated the application in several
> different areas of the application and the code I'm showing below used
> to work without issue. The code is adding a pack lines from a gridview
> on the screen. It knows which order and release to ship against based
> on the RAN number in the grid. When I try running the code today, I'm
> getting the following error in the appserver logs:
>
> (Procedure: 'GetOrderRelInfo bo/CustShip/CustShip.p' Line:119868) **
> No ttShipHead record is available. (91)
>
> This is thrown when I get an exception at
> "shipment.GetOrderRelInfo(ds, 0, orderRelNum, true);" I've never
> received this error from any of the methods I've called so I'm not
> sure where to start troubleshooting. The method call before it
> (shipment.GetOrderLineInfo) executes without issue. I've tried this
> with various Packs and Orders. It pulls the order release information based on the RAN number field on order releases.
>
> My method is included below. Any help is greatly appreciated.
>
> John Kreger
>
> private void btnPack_Click(object sender, EventArgs e) {
> btnPack.Enabled = false; txtStatus.Visible = true; txtStatus.Text =
> "Processing..."; txtStatus.ForeColor = Color.Gold; Refresh(); string
> AppServerDC = ""; if (Properties.Settings.Default.GoLive == true) {
> AppServerDC = Properties.Settings.Default.LiveAppServerDC;
> }
> else
> {
> AppServerDC = Properties.Settings.Default.TestAppServerDC;
> }
> using (Session epiSession = new
> Session(Properties.Settings.Default.UserName,
> Properties.Settings.Default.Password, AppServerDC,
> Session.LicenseType.Default))
> {
> CustShip shipment = new CustShip(epiSession.ConnectionPool);
> CustShipDataSet ds = shipment.GetByID(curPackID);
>
> foreach (DataGridViewRow row in grdPalJobs.Rows) { bool proceed =
> true; int orderNum, orderLineNum, orderRelNum; decimal Qty; string RAN
> = row.Cells[0].Value.ToString(); string PartNum =
> row.Cells[1].Value.ToString(); string LotNum =
> row.Cells[2].Value.ToString(); string outCredMsg; Qty =
> Convert.ToDecimal(row.Cells[3].Value.ToString());
> BOReader orderReader = new
> BOReader(epiSession.ConnectionPool);
> DataSet orders = new DataSet();
> //Add code to catch if no order has this ran.
> orders = orderReader.GetList("OrderRelSearch", "(RAN = '" + RAN +
> "')", "OrderNum,OrderLine,OrderRelNum");
> foreach (DataRow orderRow in orders.Tables[0].Rows) { orderNum =
> Convert.ToInt32(orderRow[0]); orderLineNum =
> Convert.ToInt32(orderRow[1]); orderRelNum =
> Convert.ToInt32(orderRow[2]);
> //MessageBox.Show("Order: " + orderNum.ToString() + " Line: " +
> orderLineNum.ToString() + " Release: " + orderRelNum.ToString());
>
> try
> {
> shipment.GetNewOrdrShipDtl(ds, curPackID, orderNum); } catch
> (BusinessObjectException) { MessageBox.Show("The Epicor pack you are
> trying to update is already shipped. Please reopen the pack or select
> a different pack."); proceed = false; } if (proceed == true) {
> shipment.GetOrderInfo(orderNum, out outCredMsg, ds);
> shipment.GetOrderLineInfo(ds, 0, orderLineNum, PartNum);
> shipment.GetOrderRelInfo(ds, 0, orderRelNum, true); //exception thrown
> here Epicor.Mfg.Common.BusinessObjectException - Unexpected error -
> see appserver logs.
> shipment.GetQtyInfo(ds, 0, Qty, 0m);
> }
> string opRelMsg, opCompMsg, opShipMsg, opLotMsg, opInvMsg,
> opLockQtyMsg, opAllocMsg, opPartListMsg, opLotListMsg, shipCredMsg,
> msg, opPostUpdMsg; bool cError, compError, updComplete, chkCompError,
> chgStatusError; int p = ds.ShipDtl.Count - 1; if (proceed == true) {
> ds.ShipDtl[p].LotNum = LotNum; shipment.UpdateMaster(ds, false, false,
> true, false, false, false, false, curPackID, 2, out opRelMsg, out
> opCompMsg, out opShipMsg, out opLotMsg, out opInvMsg, out
> opLockQtyMsg, out opAllocMsg, out opPartListMsg, out opLotListMsg, out
> shipCredMsg, out cError, out compError, out msg, out opPostUpdMsg, out
> updComplete, out chkCompError, out chgStatusError); //For testing
> purposes.
> MessageBox.Show(opRelMsg + opCompMsg + opShipMsg + opLotMsg + opInvMsg
> + opLockQtyMsg + opAllocMsg + opPartListMsg
> + opLotListMsg + shipCredMsg + msg + opPostUpdMsg);
> }
> grdTest.DataSource = ds.ShipDtl;
>
> }
> if (proceed)
> {
> txtStatus.Text = "Complete!";
> txtStatus.ForeColor = Color.LawnGreen; Refresh(); } else {
> txtStatus.Text = "Failed!"; txtStatus.ForeColor = Color.Red;
> Refresh(); }
>
> }
>
> }
> }
>
> [Non-text portions of this message have been removed]
>
> [Non-text portions of this message have been removed]
>
>
>


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



------------------------------------

Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and Crystal Reports and other 'goodies', please goto: http://groups.yahoo.com/group/vantage/files/.
(2) To search through old msg's goto: http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto: http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links
We've created an external application to make our traceability process a
bit smoother. I've fully integrated the application in several different
areas of the application and the code I'm showing below used to work
without issue. The code is adding a pack lines from a gridview on the
screen. It knows which order and release to ship against based on the RAN
number in the grid. When I try running the code today, I'm getting the
following error in the appserver logs:

(Procedure: 'GetOrderRelInfo bo/CustShip/CustShip.p' Line:119868) ** No
ttShipHead record is available. (91)

This is thrown when I get an exception at "shipment.GetOrderRelInfo(ds, 0,
orderRelNum, true);" I've never received this error from any of the methods
I've called so I'm not sure where to start troubleshooting. The method call
before it (shipment.GetOrderLineInfo) executes without issue. I've tried
this with various Packs and Orders. It pulls the order release information
based on the RAN number field on order releases.

My method is included below. Any help is greatly appreciated.

John Kreger

private void btnPack_Click(object sender, EventArgs e)
{
btnPack.Enabled = false;
txtStatus.Visible = true;
txtStatus.Text = "Processing...";
txtStatus.ForeColor = Color.Gold;
Refresh();
string AppServerDC = "";
if (Properties.Settings.Default.GoLive == true)
{
AppServerDC = Properties.Settings.Default.LiveAppServerDC;
}
else
{
AppServerDC = Properties.Settings.Default.TestAppServerDC;
}
using (Session epiSession = new
Session(Properties.Settings.Default.UserName,
Properties.Settings.Default.Password, AppServerDC,
Session.LicenseType.Default))
{
CustShip shipment = new CustShip(epiSession.ConnectionPool);
CustShipDataSet ds = shipment.GetByID(curPackID);

foreach (DataGridViewRow row in grdPalJobs.Rows)
{
bool proceed = true;
int orderNum, orderLineNum, orderRelNum;
decimal Qty;
string RAN = row.Cells[0].Value.ToString();
string PartNum = row.Cells[1].Value.ToString();
string LotNum = row.Cells[2].Value.ToString();
string outCredMsg;
Qty = Convert.ToDecimal(row.Cells[3].Value.ToString());
BOReader orderReader = new
BOReader(epiSession.ConnectionPool);
DataSet orders = new DataSet();
//Add code to catch if no order has this ran.
orders = orderReader.GetList("OrderRelSearch", "(RAN =
'" + RAN + "')", "OrderNum,OrderLine,OrderRelNum");
foreach (DataRow orderRow in orders.Tables[0].Rows)
{
orderNum = Convert.ToInt32(orderRow[0]);
orderLineNum = Convert.ToInt32(orderRow[1]);
orderRelNum = Convert.ToInt32(orderRow[2]);
//MessageBox.Show("Order: " + orderNum.ToString() +
" Line: " + orderLineNum.ToString() + " Release: " +
orderRelNum.ToString());

try
{
shipment.GetNewOrdrShipDtl(ds, curPackID,
orderNum);
}
catch (BusinessObjectException)
{
MessageBox.Show("The Epicor pack you are trying
to update is already shipped. Please reopen the pack or select a different
pack.");
proceed = false;
}
if (proceed == true)
{
shipment.GetOrderInfo(orderNum, out outCredMsg,
ds);
shipment.GetOrderLineInfo(ds, 0, orderLineNum,
PartNum);
shipment.GetOrderRelInfo(ds, 0, orderRelNum,
true); //exception thrown here Epicor.Mfg.Common.BusinessObjectException -
Unexpected error - see appserver logs.
shipment.GetQtyInfo(ds, 0, Qty, 0m);
}
string opRelMsg, opCompMsg, opShipMsg, opLotMsg,
opInvMsg, opLockQtyMsg, opAllocMsg, opPartListMsg, opLotListMsg,
shipCredMsg, msg, opPostUpdMsg;
bool cError, compError, updComplete, chkCompError,
chgStatusError;
int p = ds.ShipDtl.Count - 1;
if (proceed == true)
{
ds.ShipDtl[p].LotNum = LotNum;
shipment.UpdateMaster(ds, false, false, true,
false, false, false, false, curPackID, 2, out opRelMsg, out opCompMsg, out
opShipMsg, out opLotMsg, out opInvMsg, out opLockQtyMsg, out opAllocMsg,
out opPartListMsg, out opLotListMsg, out shipCredMsg, out cError, out
compError, out msg, out opPostUpdMsg, out updComplete, out chkCompError,
out chgStatusError);
//For testing purposes.
MessageBox.Show(opRelMsg + opCompMsg +
opShipMsg + opLotMsg + opInvMsg + opLockQtyMsg + opAllocMsg + opPartListMsg
+ opLotListMsg + shipCredMsg + msg + opPostUpdMsg);
}
grdTest.DataSource = ds.ShipDtl;

}
if (proceed)
{
txtStatus.Text = "Complete!";
txtStatus.ForeColor = Color.LawnGreen;
Refresh();
}
else
{
txtStatus.Text = "Failed!";
txtStatus.ForeColor = Color.Red;
Refresh();
}

}

}
}


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

You need to do something like this before the call
ds.ShipHead.Rows[0].RowMod = "U";
this will ensure the BO method has the temp table for shiphead available to it.
Really it is a bug in the progress logic.

Hope it helps

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of John Kreger
Sent: 09 July 2013 22:58
To: vantage@yahoogroups.com
Subject: [Vantage] 905.700B External C# Application



We've created an external application to make our traceability process a
bit smoother. I've fully integrated the application in several different
areas of the application and the code I'm showing below used to work
without issue. The code is adding a pack lines from a gridview on the
screen. It knows which order and release to ship against based on the RAN
number in the grid. When I try running the code today, I'm getting the
following error in the appserver logs:

(Procedure: 'GetOrderRelInfo bo/CustShip/CustShip.p' Line:119868) ** No
ttShipHead record is available. (91)

This is thrown when I get an exception at "shipment.GetOrderRelInfo(ds, 0,
orderRelNum, true);" I've never received this error from any of the methods
I've called so I'm not sure where to start troubleshooting. The method call
before it (shipment.GetOrderLineInfo) executes without issue. I've tried
this with various Packs and Orders. It pulls the order release information
based on the RAN number field on order releases.

My method is included below. Any help is greatly appreciated.

John Kreger

private void btnPack_Click(object sender, EventArgs e)
{
btnPack.Enabled = false;
txtStatus.Visible = true;
txtStatus.Text = "Processing...";
txtStatus.ForeColor = Color.Gold;
Refresh();
string AppServerDC = "";
if (Properties.Settings.Default.GoLive == true)
{
AppServerDC = Properties.Settings.Default.LiveAppServerDC;
}
else
{
AppServerDC = Properties.Settings.Default.TestAppServerDC;
}
using (Session epiSession = new
Session(Properties.Settings.Default.UserName,
Properties.Settings.Default.Password, AppServerDC,
Session.LicenseType.Default))
{
CustShip shipment = new CustShip(epiSession.ConnectionPool);
CustShipDataSet ds = shipment.GetByID(curPackID);

foreach (DataGridViewRow row in grdPalJobs.Rows)
{
bool proceed = true;
int orderNum, orderLineNum, orderRelNum;
decimal Qty;
string RAN = row.Cells[0].Value.ToString();
string PartNum = row.Cells[1].Value.ToString();
string LotNum = row.Cells[2].Value.ToString();
string outCredMsg;
Qty = Convert.ToDecimal(row.Cells[3].Value.ToString());
BOReader orderReader = new
BOReader(epiSession.ConnectionPool);
DataSet orders = new DataSet();
//Add code to catch if no order has this ran.
orders = orderReader.GetList("OrderRelSearch", "(RAN =
'" + RAN + "')", "OrderNum,OrderLine,OrderRelNum");
foreach (DataRow orderRow in orders.Tables[0].Rows)
{
orderNum = Convert.ToInt32(orderRow[0]);
orderLineNum = Convert.ToInt32(orderRow[1]);
orderRelNum = Convert.ToInt32(orderRow[2]);
//MessageBox.Show("Order: " + orderNum.ToString() +
" Line: " + orderLineNum.ToString() + " Release: " +
orderRelNum.ToString());

try
{
shipment.GetNewOrdrShipDtl(ds, curPackID,
orderNum);
}
catch (BusinessObjectException)
{
MessageBox.Show("The Epicor pack you are trying
to update is already shipped. Please reopen the pack or select a different
pack.");
proceed = false;
}
if (proceed == true)
{
shipment.GetOrderInfo(orderNum, out outCredMsg,
ds);
shipment.GetOrderLineInfo(ds, 0, orderLineNum,
PartNum);
shipment.GetOrderRelInfo(ds, 0, orderRelNum,
true); //exception thrown here Epicor.Mfg.Common.BusinessObjectException -
Unexpected error - see appserver logs.
shipment.GetQtyInfo(ds, 0, Qty, 0m);
}
string opRelMsg, opCompMsg, opShipMsg, opLotMsg,
opInvMsg, opLockQtyMsg, opAllocMsg, opPartListMsg, opLotListMsg,
shipCredMsg, msg, opPostUpdMsg;
bool cError, compError, updComplete, chkCompError,
chgStatusError;
int p = ds.ShipDtl.Count - 1;
if (proceed == true)
{
ds.ShipDtl[p].LotNum = LotNum;
shipment.UpdateMaster(ds, false, false, true,
false, false, false, false, curPackID, 2, out opRelMsg, out opCompMsg, out
opShipMsg, out opLotMsg, out opInvMsg, out opLockQtyMsg, out opAllocMsg,
out opPartListMsg, out opLotListMsg, out shipCredMsg, out cError, out
compError, out msg, out opPostUpdMsg, out updComplete, out chkCompError,
out chgStatusError);
//For testing purposes.
MessageBox.Show(opRelMsg + opCompMsg +
opShipMsg + opLotMsg + opInvMsg + opLockQtyMsg + opAllocMsg + opPartListMsg
+ opLotListMsg + shipCredMsg + msg + opPostUpdMsg);
}
grdTest.DataSource = ds.ShipDtl;

}
if (proceed)
{
txtStatus.Text = "Complete!";
txtStatus.ForeColor = Color.LawnGreen;
Refresh();
}
else
{
txtStatus.Text = "Failed!";
txtStatus.ForeColor = Color.Red;
Refresh();
}

}

}
}

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



[Non-text portions of this message have been removed]
Stephen,
Wow thanks. I, like an idiot, added a ds.ShipDtl.Rows[0].SetField("RowMod",
"U") instead of adding it on the ShipHead like it actually needed. Thanks
for pointing it out.

Good to go!

John


On Wed, Jul 10, 2013 at 7:48 AM, Stephen Edginton
<stephene@...>wrote:

> **
>
>
> Hi John,
>
> You need to do something like this before the call
> ds.ShipHead.Rows[0].RowMod = "U";
> this will ensure the BO method has the temp table for shiphead available
> to it.
> Really it is a bug in the progress logic.
>
> Hope it helps
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
> Of John Kreger
> Sent: 09 July 2013 22:58
> To: vantage@yahoogroups.com
> Subject: [Vantage] 905.700B External C# Application
>
>
> We've created an external application to make our traceability process a
> bit smoother. I've fully integrated the application in several different
> areas of the application and the code I'm showing below used to work
> without issue. The code is adding a pack lines from a gridview on the
> screen. It knows which order and release to ship against based on the RAN
> number in the grid. When I try running the code today, I'm getting the
> following error in the appserver logs:
>
> (Procedure: 'GetOrderRelInfo bo/CustShip/CustShip.p' Line:119868) ** No
> ttShipHead record is available. (91)
>
> This is thrown when I get an exception at "shipment.GetOrderRelInfo(ds, 0,
> orderRelNum, true);" I've never received this error from any of the methods
> I've called so I'm not sure where to start troubleshooting. The method call
> before it (shipment.GetOrderLineInfo) executes without issue. I've tried
> this with various Packs and Orders. It pulls the order release information
> based on the RAN number field on order releases.
>
> My method is included below. Any help is greatly appreciated.
>
> John Kreger
>
> private void btnPack_Click(object sender, EventArgs e)
> {
> btnPack.Enabled = false;
> txtStatus.Visible = true;
> txtStatus.Text = "Processing...";
> txtStatus.ForeColor = Color.Gold;
> Refresh();
> string AppServerDC = "";
> if (Properties.Settings.Default.GoLive == true)
> {
> AppServerDC = Properties.Settings.Default.LiveAppServerDC;
> }
> else
> {
> AppServerDC = Properties.Settings.Default.TestAppServerDC;
> }
> using (Session epiSession = new
> Session(Properties.Settings.Default.UserName,
> Properties.Settings.Default.Password, AppServerDC,
> Session.LicenseType.Default))
> {
> CustShip shipment = new CustShip(epiSession.ConnectionPool);
> CustShipDataSet ds = shipment.GetByID(curPackID);
>
> foreach (DataGridViewRow row in grdPalJobs.Rows)
> {
> bool proceed = true;
> int orderNum, orderLineNum, orderRelNum;
> decimal Qty;
> string RAN = row.Cells[0].Value.ToString();
> string PartNum = row.Cells[1].Value.ToString();
> string LotNum = row.Cells[2].Value.ToString();
> string outCredMsg;
> Qty = Convert.ToDecimal(row.Cells[3].Value.ToString());
> BOReader orderReader = new
> BOReader(epiSession.ConnectionPool);
> DataSet orders = new DataSet();
> //Add code to catch if no order has this ran.
> orders = orderReader.GetList("OrderRelSearch", "(RAN =
> '" + RAN + "')", "OrderNum,OrderLine,OrderRelNum");
> foreach (DataRow orderRow in orders.Tables[0].Rows)
> {
> orderNum = Convert.ToInt32(orderRow[0]);
> orderLineNum = Convert.ToInt32(orderRow[1]);
> orderRelNum = Convert.ToInt32(orderRow[2]);
> //MessageBox.Show("Order: " + orderNum.ToString() +
> " Line: " + orderLineNum.ToString() + " Release: " +
> orderRelNum.ToString());
>
> try
> {
> shipment.GetNewOrdrShipDtl(ds, curPackID,
> orderNum);
> }
> catch (BusinessObjectException)
> {
> MessageBox.Show("The Epicor pack you are trying
> to update is already shipped. Please reopen the pack or select a different
> pack.");
> proceed = false;
> }
> if (proceed == true)
> {
> shipment.GetOrderInfo(orderNum, out outCredMsg,
> ds);
> shipment.GetOrderLineInfo(ds, 0, orderLineNum,
> PartNum);
> shipment.GetOrderRelInfo(ds, 0, orderRelNum,
> true); //exception thrown here Epicor.Mfg.Common.BusinessObjectException -
> Unexpected error - see appserver logs.
> shipment.GetQtyInfo(ds, 0, Qty, 0m);
> }
> string opRelMsg, opCompMsg, opShipMsg, opLotMsg,
> opInvMsg, opLockQtyMsg, opAllocMsg, opPartListMsg, opLotListMsg,
> shipCredMsg, msg, opPostUpdMsg;
> bool cError, compError, updComplete, chkCompError,
> chgStatusError;
> int p = ds.ShipDtl.Count - 1;
> if (proceed == true)
> {
> ds.ShipDtl[p].LotNum = LotNum;
> shipment.UpdateMaster(ds, false, false, true,
> false, false, false, false, curPackID, 2, out opRelMsg, out opCompMsg, out
> opShipMsg, out opLotMsg, out opInvMsg, out opLockQtyMsg, out opAllocMsg,
> out opPartListMsg, out opLotListMsg, out shipCredMsg, out cError, out
> compError, out msg, out opPostUpdMsg, out updComplete, out chkCompError,
> out chgStatusError);
> //For testing purposes.
> MessageBox.Show(opRelMsg + opCompMsg +
> opShipMsg + opLotMsg + opInvMsg + opLockQtyMsg + opAllocMsg + opPartListMsg
> + opLotListMsg + shipCredMsg + msg + opPostUpdMsg);
> }
> grdTest.DataSource = ds.ShipDtl;
>
> }
> if (proceed)
> {
> txtStatus.Text = "Complete!";
> txtStatus.ForeColor = Color.LawnGreen;
> Refresh();
> }
> else
> {
> txtStatus.Text = "Failed!";
> txtStatus.ForeColor = Color.Red;
> Refresh();
> }
>
> }
>
> }
> }
>
> [Non-text portions of this message have been removed]
>
> [Non-text portions of this message have been removed]
>
>
>


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