I now want to insert some code into the ParentFormLoading but cannot see any of the events.I've right clicked on the Form to view Code but on the dropdown menu at the top of the code file, in the left menu, all I can see is one option, which is the Form. All the objects come up ok on the right hand side for the form.
Am using Ver 1.6.7 (all SF controls say ver 1.6.6.9) and C#
I changed to the Form1.cs but it does not seem to make any difference
I have highlighted Form1.cs in solution explorer, Right Clicked, View Code, and this gives two drop downs on top of the code. On the LHS I have only one option(StrataframeWindowsApplication.Form1) which I select , and on the RHS Form1(). which if I select, it shows me all the controls
From looking at the tutorial, I was expecting to see, on the left hand side, a drop down whcih shows all the events, and if I select one, it creates the empty block of code, into which I insert my code.
Am I on the right track ?
UI ApproachOpen the designer and select the business object. Then go to the property sheet and select the event display:
This will present all of the events for that object. At this point, double-click the ParentFormLoading event and it will automatically add the handler and take you to the method definition that gets generated. Just FYI, the default event for a BO is the ParentFormLoading event, so if you were to just double-click the BO from the form designer it would create this event for you as well.
Code ApproachThis is a bit more technical, but in short you would do the same thing that the automated process does for you by creating a handler. C# is nice in this area in code because when you go to handle an event you can tab and it will create the placeholder methods for you. But it would look like this:
Thanks for that. When I go into the PEMs and select it from there, it works fine now.
I now have a problem when trying to save. It says I cannot insert /update because the BO does not contain any PrimaryKeyFields. The BO is based on a Table with an Identity so I dont know why this is happening. I then over-rode the Primary Key of the BO with the Identity field, but still get the same error.
Is there sometning else I need to do to tell SF the field that is the primary key ?