Wednesday, November 19, 2008 ..:: Forums ::.. Register  Login
 Forums Minimize
SearchForum Home
     
  Mainstream Forums  Bugs  Deleting line i...
 Deleting line item throws exception
 
garf
81 posts
Joined
2/21/2007

Deleting line item throws exception
Posted: 22 Nov 07 5:03 AM Modified By garf  on 11/22/2007 5:04:10 AM)

Hi Splendid team,

(tested on your demo site)

Came across a bug when deleting a row in the line items of a quote, order or invoice:

The exception error thrown is: "Deleted row information cannot be accessed through the row."

Steps to reproduce:

  1. Create a Quote
  2. Add a line item and update the line
  3. Save the quote
  4. Open the quote again, and add another line item
  5. Delete the original line item above
  6. click Update .... error occurs.

 

Line 187 " EditLineItemsView.ascx.cs"

Will you let me know if you come up with a quick fix?

support
2089 posts
1st
Joined
1/3/2006

Re: Deleting line item throws exception
Posted: 22 Nov 07 10:43 AM

I believe that we fixed this bug, but we have not released the build.  Instead of directly deleting the row, we delete the row from the current set.

    //dtLineItems.Rows[e.RowIndex].Delete();
    // 08/07/2007 fhsakai.  There might already be deleted rows, so make sure to first obtain the current rows.
    DataRow[] aCurrentRows = dtLineItems.Select(String.Empty, String.Empty, DataViewRowState.CurrentRows);
    aCurrentRows[e.RowIndex].Delete();

 

garf
81 posts
Joined
2/21/2007

Re: Deleting line item throws exception
Posted: 22 Nov 07 1:52 PM

Correct, I added that fix. It's actaully here that it occurs:

 

protected void grdMain_RowUpdating(object sender, GridViewUpdateEventArgs e)

{
if ( dtLineItems != null )
{

GridViewRow gr = grdMain.Rows[e.RowIndex];
HiddenField txtLINE_ITEM_TYPE = gr.FindControl("LINE_ITEM_TYPE" ) as HiddenField ;
TextBox txtNAME = gr.FindControl("NAME" ) as TextBox ;
HiddenField txtMFT_PART_NUM = gr.FindControl("MFT_PART_NUM" ) as HiddenField ;
HiddenField txtVENDOR_PART_NUM = gr.FindControl("VENDOR_PART_NUM" ) as HiddenField ;
HiddenField txtPRODUCT_TEMPLATE_ID = gr.FindControl("PRODUCT_TEMPLATE_ID" ) as HiddenField ;

//DropDownList lstTAX_CLASS = gr.FindControl("TAX_CLASS") as DropDownList;
TextBox txtQUANTITY = gr.FindControl("QUANTITY" ) as TextBox ;
TextBox txtLINE_DISCOUNT_C = gr.FindControl("LINE_Item_DISCOUNT_C") as TextBox;
HiddenField txtCOST_PRICE = gr.FindControl("COST_PRICE" ) as HiddenField ;
HiddenField txtCOST_USDOLLAR = gr.FindControl("COST_USDOLLAR" ) as HiddenField ;
HiddenField txtLIST_PRICE = gr.FindControl("LIST_PRICE" ) as HiddenField;
HiddenField txtLIST_USDOLLAR = gr.FindControl("LIST_USDOLLAR" ) as HiddenField ;
TextBox txtUNIT_PRICE = gr.FindControl("UNIT_PRICE" ) as TextBox ;
HiddenField txtUNIT_USDOLLAR = gr.FindControl("UNIT_USDOLLAR" ) as HiddenField ;
TextBox txtEXTENDED_PRICE = gr.FindControl("EXTENDED_PRICE" ) as TextBox ;
HiddenField txtEXTENDED_USDOLLAR = gr.FindControl("EXTENDED_USDOLLAR" ) as HiddenField ;
TextBox txtDESCRIPTION = gr.FindControl("DESCRIPTION" ) as TextBox ;
DataRow row = dtLineItems.Rows[e.RowIndex];

// 03/30/2007 Paul. The text controls are empty. Use the Request object to read the data.
if ( txtLINE_ITEM_TYPE != null ) row["LINE_ITEM_TYPE"] = txtLINE_ITEM_TYPE.Value;         --------------------------->  THORWS ERROR HERE

garf
81 posts
Joined
2/21/2007

Re: Deleting line item throws exception
Posted: 22 Nov 07 2:08 PM
one more note, it's only when you are working with 2 rows. create 2, delete the top row (rowindex = 0) then try to edt and update the 2nd row which is now rowindex = 0.
garf
81 posts
Joined
2/21/2007

Re: Deleting line item throws exception
Posted: 07 Dec 07 12:43 PM
Any ideas on this bug as far as a fix goes?
  Mainstream Forums  Bugs  Deleting line i...

Forum Home  Search       

Copyright (c) 2006-2008 SplendidCRM Software, Inc. All Rights Reserved.   Terms Of Use  Privacy Statement
DotNetNuke® is copyright 2002-2008 by Perpetual Motion Interactive Systems Inc.
SplendidCRM and SplendidCRM Software are trademarks of SplendidCRM Software, Inc. SugarCRM is a trademark of SugarCRM Inc. in the United States, the European Union and other countries. All other trademarks used in this web site are the property of their respective owners.