I have created a window for our sales orders that looks like the following screen shot. Please note two things: 1) The selected customer has a range of addresses to choose from (2 in the case displayed); 2) The selected customer has a range of contacts to choose from (1 in the case displayed).
The next screen shot shows the address list available...it reflects ALL addresses in the system, not just the addresses specific to the customer. Also, the same result occurs with the contacts. The correct address and contact are selected; however, the lists should be limited to only the addresses and contacts pertinent to the customer.
I am at a loss to figure out how to do this. Here is the code that I am using to populate the window:
The initial binding of the lists to the combo boxes seems to be working fine, even with the null object inserted and the list sorted. The limiting of the list is the tricky part. I have attempted to contact support a couple of times...I believe I had spoken with Paul. He suggested to utilize the bindingsource objects. This is what I am trying to do. I have gotten rather far with the objects, but just cannot seem to get around this corner.
What is the trick to doing this with your business objects? I will continue working on the problem. I am close, I believe.
A second, related issued is the changing of the customer. If I change the customer, I want to updates several things: customer ID, default commission, addresses and default bill-to and ship-to, contacts and default carrier (based on default ship-to). What event should I focus on in order to make this happen? If I use the selectedindexchanged event, the code fires whenever I change sales orders. That is not good. I only want the event to fire when I change the customer on the currently selected sales order. I cannot imagine that this is a very difficult thing. I have gone through all of the videos and the documentation. It just isn't getting me past these humps.
Hope to hear from you soon.