FirmAcct oFirmAcct = new FirmAcct(); FirmAcctDefaults FAD = new FirmAcctDefaults(businessID, firmID); oFirmAcct.NewEntity(FAD); oFirmAcct.Entity.FirmAcctBankAcctNbr = bankacctNbr; oFirmAcct.Entity.FirmAcctName = firmacctname; oFirmAcct.SaveEntity(); return oFirmAcct.Rules.GetAllBrokenRules();Now, when the NewEntity method runs it steps through the HookSetDefaultValues method shown here"
protected override void HookSetDefaultValues(DataRow dataRow) { FirmAcctEntity Entity = this.CreateEntityObject(); Entity.SetDataRow(dataRow); if (this.DefaultValues != null) { // Store the dynamic default values via the entity object Entity.BusinessID = Defaults.BusinessID; Entity.FirmID = Defaults.FirmID; } // Store the hard-coded default values via the entity object Entity.FirmAcctCashTradeSw = false; Entity.FirmAcctABA = " "; Entity.FirmAcctBankAcctNbr = " "; Entity.FirmAcctBankName = " "; Entity.FirmAcctCashAcctNbr = " "; Entity.FirmAcctName = " "; Entity.FirmAcctCommMinimum = 0; Entity.FirmAcctCommPerShare = 0; Entity.FirmAcctCustomerBrokerSw = true; }When I get back to the test bench code after running NewEntity, I check the Entity values and the character fields are all null and the values set the the Defaults class are zero (even though I passed a value into the test code (firmID, businessID). So when the SaveEntity runs, it obviously fails due to not null constraints or foreign key contstraints due to the Entity values not being valid.