Ben Chase (09/14/2007)
I'm not sure on that. However, in your global.asax you can turn on the debugging on the data source to see what commands are being executed against the data source:
MicroFour.StrataFrame.Data.DataBasics.DataSources[""].SetDebugOn("C:\\Folder\\debug.html", true);
This will create a new file at c:\Folder\debug.html that will contain debug information on the commands that are executed against the data source.
You can also add an event handler to the CurrentDataTableRefilled event of your Supplier business object, put a break point in it, and check the call stack when the breakpoint is reached. That will tell you if anything else is automatically repopulating the business object.
I've tracked down the issue. I had to remove some references and ties in how it was populating the Supplier business object and more carefully looked at the attributes on the BLLM object. However, it would still be helpful to have some kind of documentation about the BLLM, it's default values, and how they affect the related entities.
This has all had a cascading effect and I've been fighting this new issue for the last three days and there's no reason why what I have shouldn't work. This is a simple, 1-M relationship between an entity and an address. First, I populated the parent entity. I have tried multiple methods to populate the child entity, but it's not pulling the correct ID from the parent entity to populate the child entity.
Contact.FillByParentPrimaryKey(intVendor);
BusinessParentRelationship ContactAddressRel = new BusinessParentRelationship();
ContactAddressRel.ParentBusinessObjectType = typeof(ContactBO).ToString();
ContactAddressRel.ParentPrimaryKeyField = new string[] { "ID_CON" };
ContactAddressRel.ForeignKeyField = new string[] { "ID_CON" };
ContactAddress.ParentRelationship = ContactAddressRel;
ContactAddress.FillByParentPrimaryKey(Contact.CurrentRow["id_con"]);
The problem I'm having, is that it pulls the contacts related to the vendor, in my case two different contacts with primary keys 3 and 4.
When I try to populate the ContactAddress object, it constantly tries to pull the incorrect PK for the contact. Contact 3 has no associated address (so it will be blank) and Contact 4 has an associated address record. The code continues to send 3 as the Primary Key, even when I've navigated to the next Contact (#4).
I've also tried specifying the parent-child relationship options with:
Contact.ChildBusinessObjects.Add(ContactAddress);
//Contact.ChildAutoFilterOption = AutoChildFilterOptions.MatchCurrentRow;
Contact.ChildAutoFilterOption = AutoChildFilterOptions.CascadeRowFilter;
This results in a NullReferenceException when I try to specify the ChildAutoFilterOption (doesn't matter which option I use, it throws an exception). I can't specify a parent relationship in the child object properties because ContactAddress is a generic "AddressBO" type that has a different parent relationship (I use the same business object to specify a SupplierAddress object -- and this one works fine and pulls the correct address record(s) for the supplier/vendor).
What is going on here? Why will it not pull the correct CurrentRow so I can get the right address object?
Thanks!