CustomersBO.OrdersBO.OrderItemsBO.ItemPrice
How can I do that for SF Business Object?
This is getting better when changing the code as follow:
Private
Public ReadOnly Property [InsuranceCompany]() As InsuranceCompanyBO
Get
_insuranceCompany.FillByPrimaryKey(
_insuranceCompany.NewRow()
I now get an error when trying to use this property in a code like this:
Dim
Look at the attached image for the error: NullReferenceException was unhandled by user code. Object reference not set to an instance of an object.
What I understand about this error is that I would need to create an instance of this object in order to use this property, while when using the original method there was not need to do that, guess because previous method was always creating an instance of the class with this code:
Dim loLookupBO As New InsuranceCompanyBO
So far, the error has nothing to do with setting values to the created new row. When using BO.NewRow() SF will populate it with the default values which are good enough in my case.
In order to make it work I added a "New" command to initialize the Private BO variable like this:
Then I made some changes to the property code to make sure the BO is filled all the time, like this:
_insuranceCompany.CurrentDataTable.AcceptChanges()
So far the code above is working fine.