Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Child List for field xxx cannot be created for DataGridV
Message
De
09/07/2010 08:18:07
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
 
À
08/07/2010 22:50:34
Jeff Corder
Ambit Technologies, LLC
Missouri, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01471928
Message ID:
01471975
Vues:
29
I am afraid this is probably going to boil down to getting something out of order. Typically these settings just go in the business object that *can* be registered as a child. Then when you register a biz obj as a child, they take effect.
this.AutoDeleteOnParentDeleted = true;
this.AutoNewOnParentAdded = false;
this.AutoEmptyOnParentAdded = true;
this.SetForeignParentKeyField = "InvoiceFK";
Is the first part of your code below in a form? Web or windows?

I am not sure if I understand this line.
oSalesDocument.GetEmptyDataSet(); // Contains Invoices, InvoicesItems...
Your comment indicates this has Invoices and Invoice Items. Can you provide more detail about this? Is the oSalesDocument an instance of the Invoice?

Your registration of InvoiceItems comes after the call to GetEmptyDataSet() and you may have better luck doing all your registration things up front before you make calls to any business object. The registration sets up the Events to be raised including events on a biz obj registered as a child.

Sorry, I am just not quite sure I got the whole picture yet. A bit more info might be helpful.
Tim


>As an additional tidbit, a symptom is that in
>mmBusinessObject.SetCurrentDataSet(DataSet ds, string tableName, bool setRequiredFields, raiseEvents, int rowNumber)
>
>ds has been initialized, but there are no tables in the dataset. If I skip over
>
>this._currentDataSet = ds;
>
>I don't get an error, and everything fills as expected. I haven't tracked down why it's not filling yet.
>
>
>
>
>oSalesDocument.GetEmptyDataSet(); // Contains Invoices, InvoicesItems...
>
>this.oInvoice = (Invoices)RegisterPrimaryBizObj(new Invoices());
>oSalesDocument.SetInvoices(oInvoice); // Sets oSalesDocument.Invoices = oInvoices
>
>this.oInvoicesItem = (InvoicesItems)RegisterBizObj(new InvoicesItems());
>oSalesDocument.SetInvoicesItems(oInvoicesItem); // Sets oSalesDocument.InvoicesItems = oInvoicesItems, sets child relationship
>
>
>SalesDocuments Biz Obj
>
> public void SetInvoicesItems(InvoicesItems oII)
> {
> this.oInvoicesItem = oII;
> ParentObj.RegisterChildBizObj(BizObj);
> BizObj.AutoDeleteOnParentDeleted = true;
> BizObj.AutoNewOnParentAdded = false;
> BizObj.AutoEmptyOnParentAdded = true;
> oII.SetForeignParentKeyField = "InvoiceFK";
> }
>
>
>oInvoice.NewRow() is what loads the data and causes the error
Timothy Bryan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform