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