Getting the ChildFormDialog to Work


Author
Message
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
The following code (C#, sorry VB.NETers) is setup basically like the CRM sample application's Orders and Items:

private Boolean _NewItem;

public SalesOrderDetails(bool pIsNewItem)
{
    InitializeComponent();
    _NewItem = pIsNewItem;
}

private void SalesOrderDetails_Load(object sender, EventArgs e)
{
   
if (_NewItem)
    {
       
this.mSalesOrderDetails.Add();
   
}
   
else
   
{
       
this.mSalesOrderDetails.Edit();
       
this.mPartTemp.FillByPrimaryKey(mSalesOrderDetails.partindex);
       
if (this.mPartTemp.Count > 0)
        {
            ItemNumTextEdit.Text =
this.mPartTemp.partnum;
        }
        RefreshSubtotal(
true);
        RefreshUI(
true);
    }
}

The red highlighted line is where the application error with a BusinessLayerException stating the following:

There are no rows in the current data table.  An edit is not allowed.

The ChildFormDialog is supposed to take care of passing the BOs to the ChildForm, isn't it?  I have the BusinessObjectTranslation setup correctly.  My source is the SalesOrder form's SalesOrderDetail BO (mSalesOrderDetails) and the destination is the SalesOrderDetail form's SalesOrderDetail BO (also called mSalesOrderDetails).

Is there something else that I need to do?  What am I doing wrong?

Thanks,
Bill

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Bill Cunnien - 18 Years Ago
Greg McGuffey - 18 Years Ago
Greg McGuffey - 18 Years Ago
Bill Cunnien - 18 Years Ago
                     Let the bombardment begin! :P
Greg McGuffey - 17 Years Ago
                         Still looking for help on this...bump. :)
Bill Cunnien - 17 Years Ago
StrataFrame Team - 17 Years Ago
                         [quote][b]Ben Chase (01/04/2008)[/b][hr][quote] ... check the .Count...
Bill Cunnien - 17 Years Ago
                             That was the culprit! I had created a "new" BO to do the work of...
Bill Cunnien - 17 Years Ago
                                 Glad you found your problem :)
Trent L. Taylor - 17 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search