Theo,
>I finally got it to work but had to use the following code:
>
>protected override void HookParentRetrieved(mmBusinessObject bizObj, mmBusinessStateChangeEventArgs e)
>{
> this.GetInvoicesByCustomerAndCurrencyID(e.PrimaryKeyValues[0].ToString(), e.PrimaryKeyValues[1].ToString());
>}
>
>Adding the ToString() to each primary key value did the trick, but has introduced another issue. Now I get the "Object reference not set to an instance of an object." message when the parent table is empty? Any thoughts on why this may be happening.
Sure...when the table is empty, then the primary key values are null. Add a check to this method to determine if there are any key values in the event args primary key collection. For example:
protected override void HookParentRetrieved(mmBusinessObject bizObj, mmBusinessStateChangeEventArgs e)
{
if (e.PrimaryKeyValues.GetLength > 0)
{
this.GetInvoicesByCustomerAndCurrencyID(e.PrimaryKeyValues[0].ToString(), e.PrimaryKeyValues[1].ToString());
}
}
>Finally, could you provide me with a Jump Start sample of a business object that would use two parent keys to retrieve a child dataset?
I don't have the time to write up something like this right now, but I'll add it to my to-do list for future documentation.
Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com